First read the Tasks basic on this page, to understand the basic tasks based approach of the ESP-IDF / FreeRTOS.
IDLE Watchdog
The ESP-IDF created task for each CPU core (called “IDLE0”, and “IDLE 1” if there is a second core) are idle tasks that reset watchdog timeout whenever that respective core is idling. This means by design, esp-idf requires and forces that each core never be fully busy for too long. If this happens (such as an infinite loop that doesn’t call a long enough vTaskDelay or its equivalent anywhere), it will result in the watchdog being triggered.
If you don’t want to delay your applications main loop for 10mS periodically
Options to deal with IDLE# task watchdog
- Don’t allow any task to fully consume a core, so that it idles frequently enough for the watchdog to stay happy.
- Bear in mind you only need to let the IDLE task run before the watchdog time period runs out, you don’t have to call vTaskDelay() every iteration of your main loop.
- Disable the watchdog
- Set the tick rate to, say, 1000Hz. FreeRTOS will spend more time in context switch interrupts, so you have a few less CPU cycles available for your program, but you’d be able to delay a task for >= 1ms.