Operating Systems and Embedded Software · Safety mechanism
Watchdog TimerWDT
Also known as watchdog, hardware watchdog, Watchdog Manager (WdgM)
A hardware timer that resets or otherwise recovers a system if software fails to service it within a configured timeout, providing a last line of defence against hangs and runaway code.
Explanation
A watchdog timer counts down continuously, and healthy software restarts the count at regular intervals (often called kicking or pinging the watchdog). If the software hangs or loops, the timer expires and triggers a reset or another configured reaction.
On Linux, a user-space daemon typically writes to /dev/watchdog at regular intervals, and the driver then services the hardware. The nowayout option prevents the watchdog from being disabled once it has started, so a crashed daemon still leads to a reboot. Some devices also support a pre-timeout that warns the kernel shortly before the reset, giving it time to record diagnostic information.
A single periodic kick only proves that something is still running. AUTOSAR's Watchdog Manager therefore supervises individual software entities using alive supervision (timing of periodic software), deadline supervision (timing of aperiodic software) and logical supervision (correct execution sequence), and takes configurable recovery actions when it detects a violation.
How it works
Software configures the timeout and starts the watchdog. A monitoring task or daemon services it periodically, ideally only after confirming that critical tasks have made progress. If servicing stops, the counter expires and the hardware asserts a reset, an interrupt or a pre-timeout warning. Boot code can then log the cause and restart the system in a known state.
Automotive applications
- Recovering ECUs from software hangs
- Supervising control-task timing in safety-related systems
- Rebooting telematics units after kernel lock-ups
- Monitoring a main processor from an external safety MCU or PMIC
Example
In an electric power-steering ECU, the Watchdog Manager checks that the 2 ms motor-control runnable reaches its checkpoints on time and in order. If logical supervision detects a skipped checkpoint, a configured reaction stops servicing the external watchdog, which resets the microcontroller into a safe state.
An illustrative example: any figures in it are worked numbers, not measurements.
References
- The Linux Watchdog driver API (opens in a new tab)
“A Watchdog Timer (WDT) is a hardware circuit that can reset the computer system in case of a software fault.”
- Specification of Watchdog Manager (Document UID 80), R26-11 (opens in a new tab)
Definitions are original summaries. Standards text is not reproduced; follow the links for the official publications.