The hardware independent interface to enable internal hardware watchdogs.
The hal_watchdog_init
interface can be used to set a recurring watchdog timer to fire no sooner than in ‘expire_secs’ seconds.
int hal_watchdog_init(uint32_t expire_msecs);
Watchdog needs to be then started with a call to hal_watchdog_enable()
. Watchdog should be tickled periodically with a frequency smaller than ‘expire_secs’ using hal_watchdog_tickle()
.
The OS initializes and starts a watchdog timer and tickles it periodically to check that the OS is running properly. This can be seen in /kernel/os/src/os.c.