Commit graph

7 commits

Author SHA1 Message Date
Nick Ward e0f18128bf task_wdt: fix silent init failures
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>
2021-10-01 15:21:32 +02:00
Andrzej Głąbek df1125a58c task_wdt: Fix the way the kernel timer is used
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>
2021-07-07 07:44:22 -05:00
Martin Jäger a46a36a4cf task_wdt: Pause hardware wdt during debugging
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>
2021-05-21 05:00:07 -05:00
Martin Jäger 79531c86a2 task_wdt: use correct hardware watchdog channel number
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>
2021-05-20 13:18:45 -05:00
Gerard Marull-Paretas f163bdb280 power: move reboot functionality to os lib
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>
2021-04-28 20:34:00 -04:00
Anas Nashif fe0872c0ab clocks: rename z_tick_get -> sys_clock_tick_get
Do not use z_ for internal APIs, z_ is for private APIs within one
subsystem only.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-03-19 11:22:17 -04:00
Martin Jäger 1aaf508bde task_wdt: add task-level watchdog subsystem
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>
2021-03-15 12:24:54 +01:00