Intensive calculation and should not yield to other tasks). Single task will need to monopolise the CPU (for example, if you expect the app will do a long This should be set to at least as long as you expect any The default timeout period for the TWDT is set using config itemĬONFIG_ESP_TASK_WDT_TIMEOUT_S. Once all tasks have unsubscribedįorm the TWDT, the TWDT can be deinitialized by calling A task that has been unsubscribed should no Indicates that one or more tasks have been starved of CPU time or are stuck in aĪ watched task can be unsubscribed from the TWDT usingĮsp_task_wdt_delete(). Failure byĪny subscribed tasks to periodically call esp_task_wdt_reset() Periodically call esp_task_wdt_reset() to reset the TWDT. A task can then subscribe to the TWDT usingĮsp_task_wdt_add() in order to be watched. The TWDTĬan be initialized by calling esp_task_wdt_init() which will configure The TWDT is built around the Hardware Watchdog Timer in Timer Group 0. In the user code, in order to receive the timeout event and handle it differently. It is also possible to redefine the function esp_task_wdt_isr_user_handler Information about which tasks failed to reset the TWDT in time and which Not reset within the TWDT timeout period, a warning will be printed with Periodically to indicate that they have been allocated CPU time. Peripheral, or a task that is stuck in an infinite loop.īy default the TWDT will watch the Idle Tasks of each CPU, however any task can
This can be an indicator of poorly written code that spinloops on a Yielding to a lower-priority task thus starving the lower priority task fromĬPU time.
This is a symptom ofĬPU starvation and is usually caused by a higher priority task looping without Running for a prolonged period of time without yielding. The Task Watchdog Timer (TWDT) is responsible for detecting instances of tasks The panic reason as “Interrupt wdt timeout on CPU0” or “Interrupt wdt timeout on CPU1” (as If the panic handler executes, it will display
Overwritten by garbage), it will hard-reset the SOC. Some reason cannot execute the NMI handler that invokes the panic handler (e.g. The interrupt watchdog is built around the hardware watchdog in timer group 1. Depending on the configuration of the panic handler, it can also blindly reset the CPU, which may be causing a register dump and an opportunityįor the programmer to find out, using either OpenOCD or gdbstub, what bit of code is stuck with interruptsĭisabled. The default action of the interrupt watchdog is to invoke the panic handler. Infinite loop with interrupts disabled or hangs in an interrupt.
A blocked task switching interrupt can happen because a program runs into an Is bad because no other tasks, including potentially important ones like the WiFi task and the idle task,Ĭan’t get any CPU runtime. The interrupt watchdog makes sure the FreeRTOS task switching interrupt isn’t blocked for a long time.