1 Introduction

Test Name: WDT Start-up Diagnostic  

 

Purpose of test: The watchdog timer (WDT) in Windowed mode, or Windowed Watchdog Timer (WWDT), is a system function that monitors correct program operation and allows recovery from error situations such as runaway or deadlocked code. This diagnostic verifies that it is working correctly.  

 

This diagnostic is intended to be executed at start-up before entering the main function, as it involves multiple device resets. The diagnostic supports both the scenario when the WWDT is enabled (and thus locked) through the FUSE and when it is not. In the former scenario, the diagnostic execution time will depend on the time-out period chosen for the WWDT, while in the latter scenario the WWDT is enabled with the shortest WWDT time-out period and disabled upon exiting the diagnostic.

This diagnostic function assumes global interrupts are disabled.

Timer/Counter A (TCA) is used to verify the timing of the WWDT clock source since the TCA clock source is independent. The timer is set up and teared down as part of running the diagnostic. It is assumed that the timer resource is free at start-up before entering main.

Attention:

This diagnostic clears all reset flags in the RSTFR register. Use the DIAG_WWDT_GetRSTFRCopy() API to retrieve the copy of the register at start-up to handle unexpected resets in the application.

If the WWDT is enabled through fuses, it is the responsibility of the system integrator to issue the first Watchdog Reset (WDR) instruction (wdt_reset()) to start the first closed period when entering the main function.

The misra_project_deviation and misra_specific_deviation pages shows an overview of the general project MISRA C:2012 deviations and specific deviations for the WWDT Start-up Diagnostic APIs.  

 

API Documentation:  

Windowed Watchdog Timer Start-up