TS-4900 Watchdog: Difference between revisions

From embeddedTS Manuals
No edit summary
No edit summary
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
The watchdog is a timer that can help ensure the system remains stable and responsive. This can be used as a last resort to reset the system if it detects a certain process or application is not responding as expected.
The CPU's watchdog timer is a hardware component that helps ensure the stability and responsiveness of the system. It does this by resetting the system if it detects that a certain process or application is not functioning as expected. If the watchdog timer is not regularly reset or "fed," it will expire and trigger a system reset.
 
By default, the watchdog timer has a timeout period of 60 seconds. However, it is powered by a ring oscillator that may not be perfectly accurate, meaning the timer may expire more quickly than expected. To ensure that the watchdog timer does not expire prematurely, it should be reset or "fed" at least 4 times more frequently than its configured timeout period. For example, if the timeout is set to 60 seconds, the watchdog should be reset at least every 15 seconds.
 
The kernel provides an interface to the watchdog driver at /dev/watchdog. This interface can be used to enable the watchdog timer by feeding it from an application. For more information on using the watchdog timer, refer to the kernel documentation at the following links:


Our images typically do not feed the watchdog by default, but this can be brought into your image by feeding the watchdog from your application. The kernel provides an interface to the watchdog driver at /dev/watchdog.  Refer to the kernel documentation for more information:
* [https://github.com/embeddedTS/linux-3.10.17-imx6/blob/master/Documentation/watchdog/watchdog-api.txt watchdog-api.txt]
* [https://github.com/embeddedTS/linux-3.10.17-imx6/blob/master/Documentation/watchdog/watchdog-api.txt watchdog-api.txt]
* [https://github.com/embeddedTS/linux-3.10.17-imx6/blob/master/Documentation/watchdog/src/watchdog-simple.c watchdog-simple.c]
* [https://github.com/embeddedTS/linux-3.10.17-imx6/blob/master/Documentation/watchdog/src/watchdog-simple.c watchdog-simple.c]
By default the watchdog has a 60 second timeout and daemons like systemd will aggressively feed the watchdog more often than that. The CPU watchdog timer runs off of a ring oscillator in the CPU which does not provide a lot of accuracy. The ring oscillator may be up to 2x the intended frequency, so a 60 second timeout may expire in as little as 30 seconds. Your watchdog should then generally be fed at least 4x faster than your configured watchdog timeout. For example, if the timeout is 60 seconds the watchdog should be fed at least every 15 seconds to ensure that it does not expire.

Latest revision as of 15:47, 16 December 2022

The CPU's watchdog timer is a hardware component that helps ensure the stability and responsiveness of the system. It does this by resetting the system if it detects that a certain process or application is not functioning as expected. If the watchdog timer is not regularly reset or "fed," it will expire and trigger a system reset.

By default, the watchdog timer has a timeout period of 60 seconds. However, it is powered by a ring oscillator that may not be perfectly accurate, meaning the timer may expire more quickly than expected. To ensure that the watchdog timer does not expire prematurely, it should be reset or "fed" at least 4 times more frequently than its configured timeout period. For example, if the timeout is set to 60 seconds, the watchdog should be reset at least every 15 seconds.

The kernel provides an interface to the watchdog driver at /dev/watchdog. This interface can be used to enable the watchdog timer by feeding it from an application. For more information on using the watchdog timer, refer to the kernel documentation at the following links: