The Watchdog Timer (WDOG) keeps a watch on the system functioning and resets it in case of its failure. Reasons for failure include run-away software code and the stoppage of the system clock that in a safety critical system can lead to serious consequences. In such cases, the watchdog brings the system into a safe state of operation. The watchdog monitors the operation of the system by expecting periodic communication from the software, generally known as servicing or refreshing the watchdog. If this periodic refreshing does not occur, the watchdog resets the system.
1. FRDM-K64 board.
The objective is to explain how to launch a watch dog function.It shows how to configure watch dog and shows what will happen when time out. And it explains why it looks it didn't run to the watch dog handle function .
1.Run configure tools,and then configure watch dog as follows.
It choose bus clock in PEE mode. And it opened interrupt .
2.Here we can see the details about watch dog configuration.
3.We set a variable to check if it run to handle and if it reset.
Why we set a variable but not do some other operations? See the follow picture.
Before interrupt handle and system reset , it only has 256 bus clk cycles.
4.Comment these functions because it will initial data and bss segment after reset,that means you will not see the change of the variable .
5.Add break points as follows.
6.Let us run and watch the variable change.