world leader in high performance signal processing
Trace: » watchdog

Watchdogs (woof!)

A watchdog timer is a hardware device that will reset the system when certain fault conditions are met. While the watchdog hardware itself is pretty simplistic, the userspace watchdog daemon can get quite complex in determining what a fault condition means.

The typical use case looks a bit like:

  • boot up system
  • load watchdog device driver (but don't do anything)
  • start userspace watchdog daemon
    • open watchdog device driver (/dev/watchdog)
    • initialize the timer
    • periodically reload the timer
  • system locks up
  • userspace watchdog daemon is unable to reload the timer
  • hardware watchdog resets the system

Some of the more elaborate userspace daemons can actually do things like query the network status, check the system load, monitor hardware status (temp/etc…), and reboot the system if the state of the machine is outside of the configured parameters.

Blackfin Watchdog

The Blackfin watchdog timer is an on-chip 32bit timer that can generate a hardware reset, nonmaskable interrupt (NMI), or general-purpose interrupt if the timer expires before the software has a chance to reload the timer.

If you need to access the watchdog outside of userspace, please refer to the HRM for your processor variant.

Userspace Watchdogs

Regardless of which watchdog you choose to use, you should make sure it gets started at boot. Typically this is done by adding a line to your /etc/rc or /etc/inittab file.

Simplest Watchdog

Here is about the simplest userspace watchdog possible.

file: Documentation/watchdog/src/watchdog-simple.c

scm failed with exit code 1:
file does not exist in git

uClinux Watchdog

For a watchdog that has been tested to work properly under uClinux, please see the uClinux-dist/user/blkfin-apps/watchdog/ folder.

Linux API Documentation

Here is the documentation from the kernel for the userspace watchdog API.

file: Documentation/watchdog/watchdog-api.txt

scm failed with exit code 1:
file does not exist in git

External Resources

Complete Table of Contents/Topics