Watchdog
This chapter provides an overview of the K3 RTI-Windowed Watchdog Timer (WWDT) driver, designed to support the watchdog functionality found in TI’s AM62Ax SoCs. The WWDT offers a digital windowed watchdog mechanism, where a specific time window is defined for servicing the watchdog. If the watchdog is serviced outside this configurable window or fails to be serviced within it, the system responds by generating an interrupt to the MCU Error Signaling Module (ESM). The ESM then processes these interrupts and, if necessary, triggers the reset logic to ensure the device is reset, maintaining system reliability.
Note
Per default we configure our BSPs to let the ESM module reset the devices. This is enabled by the u-boot bootloader through the CONFIG_ESM_K3 R5 config in combination with the esm-pins properties from the device tree.
Timeout configuration
Default user space program handling the keepalive signal in our BSP is systemd. The default timeout is set to 60 seconds, and systemd will pet the watchdog at intervals of timeout/2. Configuration for systemd can be found in /usr/lib/systemd/system.conf.d/10-watchdog.conf.
[Manager]
RuntimeWatchdogSec=60
RebootWatchdogSec=120
For more details please refer to systemd’s documentation: https://www.freedesktop.org/software/systemd/man/latest/systemd-system.conf.html
You can check what process is handling your watchdog device by simply checking what process holds the device handle.
sh-phyboard-lyra-am62axx-2:~# fuser /dev/watchdog0
1 # 1 is the process id of systemd
The timeout parameter for the watchdog module can be configured by specifying it through the kernel command line. For example by passing it by the bootloader (rti_wdt.heartbeat=10).
sh-uboot:~# setenv mmcargs "setenv bootargs console=ttyS2,115200n8 earlycon=ns16550a,mmio32,0x02800000 root=/dev/mmcblk1p2 rootwait rw rti_wdt.heartbeat=10"
sh-uboot:~# saveenv
sh-uboot:~# boot
See your output to verify the modyfied timeout.
sh-phyboard-lyra-am62axx-2:~# journalctl | grep -i watchdog
phyboard-lyra-am62axx-2 systemd[1]: Using hardware watchdog 'K3 RTI Watchdog', version 0, device /dev/watchdog0
phyboard-lyra-am62axx-2 systemd[1]: Modifying watchdog timeout is not supported, reusing the programmed timeout.
phyboard-lyra-am62axx-2 systemd[1]: Watchdog running with a timeout of 10s.
Test system resets
To verify that your device resets correctly in the event of a system failure, you can deliberately trigger a kernel panic and observe whether the watchdog causes a reset. The following command forces a kernel panic using the Linux SysRq mechanism:
sh-phyboard-lyra-am62axx-2:~# echo c > /proc/sysrq-trigger
/proc/sysrq-trigger
is part of the Magic SysRq key mechanism in the Linux kernel. It allows users to send low-level commands directly to the kernel, even when the system is under heavy load or otherwise unresponsive (unless it is completely locked up).
By writing c
to /proc/sysrq-trigger
, you trigger an immediate kernel panic. This simulates a critical failure, providing a controlled way to test system behavior during a crash.
More information about SysRq commands can be found in the official Linux kernel documentation:
https://www.kernel.org/doc/html/v4.10/admin-guide/sysrq.html
This test simulates a real-world system failure. In production environments, such failures should be detected and handled automatically—typically using a hardware watchdog timer.
Triggering a kernel panic allows you to confirm:
The system crashes as expected.
The watchdog detects the failure.
The system resets in response, demonstrating automatic recovery.
This test helps ensure your watchdog configuration is effective and that your system can recover from unrecoverable errors autonomously.
Disable reset
The simplest way to prevent the reset is by disabling the CONFIG_ESM_K3 driver in U-Boot or modifying the ESM routing using the esm-pins
configuration.