1 Introduction

Test Name: WDT Start-up Diagnostic  

 

Purpose of test: The watchdog timer (WDT) 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.  

 

Description: The self-diagnostic routine verifies that the WDT is able to issue a timely system reset and that the WDT counter can be reset at start-up.

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 where the WDT 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 WDT, while in the latter scenario the WDT is enabled with the shortest WDT time-out period and disabled upon exiting the diagnostic.

Timer Counter A (TCA) is used to verify the timing of the WDT 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_WDT_GetRSTFRCopy() API to retrieve the copy of the register at start-up to handle unexpected resets in the application.

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 WDT Start-up Diagnostic APIs.  

 

API Documentation:  

Watchdog Timer Startup