esp-idf/examples/system/task_watchdog/README.md
pedro.minatel da471dfcd1 Examples README's updated on peripherals, system and wifi
Updated main examples README to add missing examples folders and Getting Started links
Updated wifi/fastscan example README
Updated wifi examples README
Updated wifi main examples README
Added instructions and removed obviousness from examples README
Updates on example README in peripherals, system and wifi
Updates on example README in peripherals and added wave form pictures on wave_gen example
Updates and review on example README
Revision on unit style convention
Added the getting started link for each supported version
Readme review and recommended enhancements
Added the default note on the wave form option info
Added the ESP32-C3 support information on the temperature sensor example README
Added Getting Started information for ESP32-S2 and ESP32-C3
Issue fixed on the supported target on README
Resolved merge conflict
2021-04-07 14:24:38 +00:00

2.2 KiB

Task Watchdog Example

This test code shows how to initialize the task watchdog, add tasks to the watchdog task list, feeding the tasks, deleting tasks from the watchdog task list, and deinitializing the task watchdog.

How to use example

Before project configuration and build, be sure to set the correct chip target using idf.py set-target <chip_name>.

Hardware Required

  • A development board with ESP32/ESP32-S2/ESP32-C3 SoC (e.g., ESP32-DevKitC, ESP-WROVER-KIT, etc.)
  • A USB cable for Power supply and programming

Configure the project

Program should run without error. Comment out esp_task_wdt_reset() to observe a watchdog timeout.

Build and Flash

Build the project and flash it to the board, then run monitor tool to view serial output:

Run idf.py -p PORT flash monitor to build, flash and monitor the project.

(To exit the serial monitor, type Ctrl-].)

See the Getting Started Guide for all the steps to configure and use the ESP-IDF to build projects.

Example Output

As you run the example, you will see the following log:

With esp_task_wdt_reset():

I (0) cpu_start: Starting scheduler on APP CPU.
Initialize TWDT
Delay for 10 seconds
Unsubscribing and deleting tasks
Complete

Without esp_task_wdt_reset():

I (0) cpu_start: Starting scheduler on APP CPU.
Initialize TWDT
Delay for 10 seconds
E (6316) task_wdt: Task watchdog got triggered. The following tasks did not reset the watchdog in time:
E (6316) task_wdt:  - reset task (CPU 0)
E (6316) task_wdt:  - reset task (CPU 1)
E (6316) task_wdt: Tasks currently running:
E (6316) task_wdt: CPU 0: IDLE
E (6316) task_wdt: CPU 1: IDLE
E (6316) task_wdt: Print CPU 0 (current core) backtrace

Troubleshooting

For any technical queries, please open an issue on GitHub. We will get back to you soon.