RTOS System Articles - Watchdog WatchDog 2

RTOS System Articles - Watchdog WatchDog 2

overview

The previous section explained the basic principles of the watchdog, the reasons and solutions for triggering the watchdog in tasks and interrupts in the RTOS system article - WatchDog[Do not feed the dog or bite you] .

This section follows the previous section and mainly discusses how to add a task to the watchdog and feed the dog in time. Readers can refer to the usage of the example to understand its basic use, and find similar APIs on the platform they use to study and research.

Task watchdog in ESP-IDF

The task watchdog (TWDT) is built around the hardware watchdog timer in timer group 0 .

TWDT can be initialized esp_task_wdt_init()by , which will configure the hardware timer.

Tasks can then esp_task_wdt_add()be added

Each task added to the task watchdog must periodically call esp_task_wdt_reset()to reset the TWDT. If any task added to the task watchdog returns a failure esp_task_wdt_reset()when , it means that the current task is stuck in a cycle before calling this function, or one or more tasks occupy the CPU for a long time, so that the current function has no chance to run esp_task_wdt_reset().

Tasks can be removed from the task watchdog monitoring queue esp_task_wdt_delete() using . Once all tasks are loaded from TWD

Guess you like

Origin blog.csdn.net/wangyx1234/article/details/129034234