ESP32 system watchdog

Interrupt watchdog

Interrupt watchdog (Interrupt watchdog) is used to detect whether the interrupt masks timeout

Since FreeRTOS task switching relies on interrupt signals, the direct impact of interrupt mask timeout is that the task cannot be switched and the system crashes.

The common reasons why the interrupt watchdog is triggered are as follows:

  1. Task closes the interrupt before entering the while() loop, and enables the interrupt without exiting the loop for a long time
  2. To be added

By CONFIG_ESP_INT_WDT_TIMEOUT_MSthe dogs increasing or decreasing the time

Task watchdog

The Task Watchdog Timer (TWDT) is used to detect whether the Task is occupying CPU resources for a long time

A task that occupies the CPU for a long time will cause other tasks to have no chance to be executed, resulting in the failure of the design function

Task watchdog is triggered for the following reasons:

  1. There is no blocking function in the while loop of task and vTaskDelay
  2. To be added

Task Watchdog default only monitors each CPU idle task, can esp_task_wdt_addcustomize the task is to add monitoring

Reference

  1. Watchdogs:https://docs.espressif.com/projects/esp-idf/zh_CN/latest/esp32/api-reference/system/wdts.html#watchdogs

Guess you like

Origin blog.csdn.net/qq_20515461/article/details/106291217