I am currently working on TI AM335x board (Starter Kit) and I would like to get the OMAP watchdog working...
As far as I know the platform automatically enables the watchdog during boot and I think it is confirmed by the following messages printed out at boot:
[ 1.510192] OMAP Watchdog Timer Rev 0x01: initial timeout 60 sec
If I am not wrong at this point if I issue the following command:
echo 0 > /dev/watchdog
the board should reboot in 60 seconds, isn't it? Instead after 60 seconds nothing happens... why? Am I missing something relevant about that? Can anybody help me?
The act of restarting a watchdog timer is commonly referred to as kicking the watchdog. Kicking is typically done by writing to a watchdog control port or by setting a particular bit in a register. Alternatively, some tightly coupled watchdog timers are kicked by executing a special machine language instruction.
A watchdog timer is used for detecting anomalies such as software stuck in an infinite loop or a frozen CPU. If an anomaly is detected, the processor will be reset automatically, to bring the device back to a stable operational state in the shortest possible time without operator intervention.
After the module is loaded, you can check /dev/watchdog on the Linux system. If this file is present, that means the watchdog kernel device driver or module was loaded. The system periodically keeps writing to /dev/watchdog. It is also called “kicking or feeding the watchdog”.
The watchdog timer is configured to generate an interrupt every 250 milliseconds. This interrupt wakes the system from Deep Sleep mode. The system delays 500 milliseconds by calling CyDelay functions and then goes into Deep Sleep again. Two LEDs are used to indicate the system status.
Ok, I've found the solution on my own.
As clearly told here, the file /dev/watchdog
must be kept open for allowing the watchdog to fire... then the right command for causing the watchdog fire is:
cat > /dev/watchdog
and then type 0: after 60 seconds the board will reboot.
It's not necessarily to keep /dev/watchdog open, if you push-on "disable watchdog timer support" (avaliable in Device Drivers->Watchdog Timer Support->...) feature on kernel menuconfig.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With