Electrical – Detecting hardware watchdog reboot on bootup

watchdog

The CPU on my embedded linux system (Armada 370) does have a hardware watchdog. It does not appear to have any way of checking at bootup time whether the bootup is a normal cold boot or a reset from a watchdog timeout (does not have a reset cause register).

Given this limitation, can anyone think of how I can determine if a hw watchdog timeout event occurred?

Best Answer

If the capability to detect reset type is not built into your system then you will have to modify the system design to provide that information. One way that this can be done is to design in a flip-flop into the circuitry. It needs to be configured in such way that it gets set by a power up event and then have a means for the software to read the state of the flip-flop and allow the software to clear the flip-flop. You can use this as a scheme to identify a reset as an initial startup reset. All other resets would happen and this flip-flop would not be set.

Another approach would be to disable the watch dog timer (WDT) on the processor and deploy an external watch dog timer component that has a watch dog timeout state bit that would be accessible and clearable by software.