1.. _task_wdt_api:
2
3Task Watchdog
4#############
5
6Overview
7********
8
9Many microcontrollers feature a hardware watchdog timer peripheral. Its purpose
10is to trigger an action (usually a system reset) in case of severe software
11malfunctions. Once initialized, the watchdog timer has to be restarted ("fed")
12in regular intervals to prevent it from timing out. If the software got stuck
13and does not manage to feed the watchdog anymore, the corrective action is
14triggered to bring the system back to normal operation.
15
16In real-time operating systems with multiple tasks running in parallel, a
17single watchdog instance may not be sufficient anymore, as it can be used for
18only one task. This software watchdog based on kernel timers provides a method
19to supervise multiple threads or tasks (called watchdog channels).
20
21An existing hardware watchdog can be used as an optional fallback if the task
22watchdog itself or the scheduler has a malfunction.
23
24The task watchdog uses a kernel timer as its backend. If configured properly,
25the timer ISR is never actually called during normal operation, as the timer is
26continuously updated in the feed calls.
27
28It's currently not possible to have multiple instances of task watchdogs.
29Instead, the task watchdog API can be accessed globally to add or delete new
30channels without passing around a context or device pointer in the firmware.
31
32The maximum number of channels is predefined via Kconfig and should be adjusted
33to match exactly the number of channels required by the application.
34
35Configuration Options
36*********************
37
38Related configuration options can be found under
39:zephyr_file:`subsys/task_wdt/Kconfig`.
40
41* :kconfig:option:`CONFIG_TASK_WDT`
42
43* :kconfig:option:`CONFIG_TASK_WDT_CHANNELS`
44
45* :kconfig:option:`CONFIG_TASK_WDT_HW_FALLBACK`
46
47* :kconfig:option:`CONFIG_TASK_WDT_MIN_TIMEOUT`
48
49* :kconfig:option:`CONFIG_TASK_WDT_HW_FALLBACK_DELAY`
50
51API Reference
52*************
53
54.. doxygengroup:: task_wdt_api
55