The task_wdt_init() API can fail to install a timeout for the fallback
hardware WDT (hw_wdt) without returning an error code. This patch
enables task_wdt_init() to return the hw_wdt install timeout error code
if the hw_wdt install timeout fails.
Signed-off-by: Nick Ward <nick.ward@setec.com.au>
Do not use periodic executions of the timer handler, as in certain
circumstances (the fallback hardware watchdog used, one or more
task_wdt channel activated but none of them being ever fed) this
would lead to no callback/reset being executed for any channel.
Instead, schedule the next timeout from the timer handler function
when the function is executed for the dummy background channel or
for a channel that was deleted.
Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
Enable the option to pause the fallback hardware watchdog if the MCU is
halted by a debugger.
This fixes issue #33509 where some boards with Nordic MCUs could not be
flashed anymore after using the task watchdog sample.
Signed-off-by: Martin Jäger <martin@libre.solar>
The hardware watchdog was always fed with channel ID 0. This is correct
in most cases, but we should still use the actual ID returned from
wdt_install_timeout.
Signed-off-by: Martin Jäger <martin@libre.solar>
Reboot functionality has nothing to do with PM, so move it out to the
subsys/os folder.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
This new subsystem can be used to supervise individual threads. It
is based on a regularly updated kernel timer, whose ISR is never
actually called in regular system operation.
An existing hardware watchdog can be used as an optional fallback if
the task watchdog itself gets stuck.
Signed-off-by: Martin Jäger <martin@libre.solar>