2.1.3.3 DIAG_WWDT_Startup()
void DIAG_WWDT_Startup (void )
Tests the WDT, protects against runaway code, deadlocks and the program counter not working.
This API checks the WDT resets in Windowed WDT mode when the timer is being cleared either too early or too late. This test will not be called from main. It will be executed before main is entered, as long as diag_wwdt_startup.h/.c is included in the compilation.
This diagnostics tests that Windowed WDT mode works by attempting to clear the WDT counter in the closed part of the WDT counter window. The device will be Reset. The next step tests that the WDT will issue a system Reset in Windowed WDT mode, if no Reset instruction is executed. If the device and WDT was Reset correctly in each step of the test, then the diag_wwdt_teststate is set to DIAG_WWDT_FSM_OK and diag_wwdt_status is set to DIAG_PASS, otherwise the diag_wwdt_teststate is set to DIAG_WWDT_FSM_FAULT and diag_wwdt_status is set to DIAG_FAIL, thereby indicating fault. Error reporting: Call DIAG_WWDT_GetResult() from main to see the status of the WWDT diagnosis.
None. |
If there is a problem with the WWDT, this test is executed. Wait for 0.25 * T_WDT to avoid timing issues with Reset vs execution of instructions, then set Fault state if the Windowed WDT module has not Reset the device as expected.