Skip to content

Watchdog

Kernel Configuration

The internal watchdog is enabled by default in the kernel configuration.

To verify that the i.MX watchdog driver (CONFIG_IMX2_WDT) is enabled in your kernel configuration:

  • In menuconfig: Device Drivers -> Watchdog Timer Support -> <*> IMX2+ Watchdog

Using a Command Line

The watchdog is activated as soon as /dev/watchdog0 is opened. The board reboots unless the watchdog is pinged within the configured timeout.

echo "1" > /dev/watchdog0

The board resets when the watchdog timeout expires.

Compile a Watchdog Test Application

The Linux kernel source tree contains a watchdog test utility at:

tools/testing/selftests/watchdog/watchdog-test.c

Install the toolchain by following the Debian FlexBuild Toolchain installation guide, then cross-compile the test utility:

arm-linux-gnueabihf-gcc \
  ./tools/testing/selftests/watchdog/watchdog-test.c \
  -o ./watchdog-test