1# Software watchdog configuration
2
3# Copyright (c) 2020 Libre Solar Technologies GmbH
4# SPDX-License-Identifier: Apache-2.0
5
6menuconfig TASK_WDT
7	bool "Task-level software watchdog"
8	select REBOOT
9	help
10	  Enable task watchdog
11
12	  The task watchdog allows to have individual watchdog channels
13	  per thread, even if the hardware supports only a single watchdog.
14
15if TASK_WDT
16config TASK_WDT_CHANNELS
17	int "Maximum number of task watchdog channels"
18	default 5
19	range 2 100
20	help
21	  The timeouts for each channel are stored in an array. Allocate only
22	  the required amount of channels to reduce memory footprint.
23
24config TASK_WDT_HW_FALLBACK
25	bool "Use hardware watchdog as a fallback"
26	default y
27	help
28	  This option allows to specify a hardware watchdog device in the
29	  application that is used as an additional safety layer if the task
30	  watchdog itself gets stuck.
31
32config TASK_WDT_MIN_TIMEOUT
33	int "Minimum timeout for task watchdog (ms)"
34	depends on TASK_WDT_HW_FALLBACK
35	default 100
36	range 1 10000
37	help
38	  The task watchdog uses a continuously restarted k_timer as its
39	  backend. This value specifies the minimum timeout in milliseconds
40	  among all task watchdogs used in the application.
41
42	  If a hardware watchdog is configured as a fallback for the task
43	  watchdog, its timeout is set to this value plus
44	  TASK_WDT_HW_FALLBACK_DELAY.
45
46config TASK_WDT_HW_FALLBACK_DELAY
47	int "Additional delay for hardware watchdog (ms)"
48	depends on TASK_WDT_HW_FALLBACK
49	default 20
50	range 1 1000
51	help
52	  The timeout of the hardware watchdog fallback will be increased by
53	  this value to provide sufficient time for corrective actions in the
54	  callback function.
55
56	  In addition to that, the delay allows to compensate deviations
57	  between different clock sources for the hardware watchdog and the
58	  kernel timer. This is especially important if the hardware watchdog
59	  is clocked by an inaccurate low-speed RC oscillator.
60
61config TASK_WDT_SHELL
62	bool "Task watchdog shell utilities"
63	depends on SHELL
64	help
65	  Activate shell module that provides Task watchdog commands.
66
67endif
68