1.. zephyr:code-sample:: task-wdt
2   :name: Task watchdog
3   :relevant-api: task_wdt_api
4
5   Monitor a thread using a task watchdog.
6
7Overview
8********
9
10This sample allows to test the :ref:`task watchdog <task_wdt_api>` subsystem.
11
12Building and Running
13********************
14
15It should be possible to build and run the task watchdog sample on almost any
16board. If a hardware watchdog is defined in the devicetree, it is used as a
17fallback. Otherwise the task watchdog will run independently.
18
19Building and Running for ST Nucleo L073RZ
20=========================================
21The sample can be built and executed for the
22:ref:`nucleo_l073rz_board` as follows:
23
24.. zephyr-app-commands::
25   :zephyr-app: samples/subsys/task_wdt
26   :board: nucleo_l073rz
27   :goals: build flash
28   :compact:
29
30For other boards just replace the board name.
31
32Sample output
33=============
34
35The following output is printed and continuously repeated (after each
36reset):
37
38.. code-block:: console
39
40   Task watchdog sample application.
41   Main thread still alive...
42   Control thread started.
43   Main thread still alive...
44   Main thread still alive...
45   Main thread still alive...
46   Control thread getting stuck...
47   Main thread still alive...
48   Task watchdog channel 1 callback, thread: control
49   Resetting device...
50