esp-idf: [v5.1] "task_wdt: esp_task_wdt_reset(783): task not found" logged a lot during boot, by idle task (IDFGH-10193)

IDF version.

release/v5.1

Development Kit.

ESP32-S3 Dev Kit C

What is the expected behavior?

not sure why this is logged so many times

Debug Logs.

E (4678) task_wdt: esp_task_wdt_reset(783): task not found
E (4678) task_wdt: esp_task_wdt_reset(783): task not found
E (4678) task_wdt: esp_task_wdt_reset(783): task not found
E (4678) task_wdt: esp_task_wdt_reset(783): task not found
E (4678) task_wdt: esp_task_wdt_reset(783): task not found
E (4688) task_wdt: esp_task_wdt_reset(783): task not found
E (4688) task_wdt: esp_task_wdt_reset(783): task not found
E (4688) task_wdt: esp_task_wdt_reset(783): task not found
E (4688) task_wdt: esp_task_wdt_reset(783): task not found
E (4688) task_wdt: esp_task_wdt_reset(783): task not found
E (4688) task_wdt: esp_task_wdt_reset(783): task not found
E (4698) task_wdt: esp_task_wdt_reset(783): task not found
E (4698) task_wdt: esp_task_wdt_reset(783): task not found
E (4698) task_wdt: esp_task_wdt_reset(783): task not found
E (4698) task_wdt: esp_task_wdt_reset(783): task not found
E (4698) task_wdt: esp_task_wdt_reset(783): task not found
E (4698) task_wdt: esp_task_wdt_reset(783): task not found
E (4698) task_wdt: esp_task_wdt_reset(783): task not found
E (4708) task_wdt: esp_task_wdt_reset(783): task not found
E (4708) task_wdt: esp_task_wdt_reset(783): task not found

Edit: Here is the backtrace:

E (5499) task_wdt: esp_task_wdt_reset(797): task not found

Backtrace: 0x420C956F:0x3FCB77D0 0x420C95E5:0x3FCB7810 0x42006DA6:0x3FCB7840 0x40387975:0x3FCB7870 0x40386092:0x3FCB78A0
0x420c956f: esp_task_wdt_reset at /Volumes/User/MBP-Google-Drive/jamcorder/firmware/esp-idf/components/esp_system/task_wdt/task_wdt.c:794

0x420c95e5: idle_hook_cb at /Volumes/User/MBP-Google-Drive/jamcorder/firmware/esp-idf/components/esp_system/task_wdt/task_wdt.c:497

0x42006da6: esp_vApplicationIdleHook at /Volumes/User/MBP-Google-Drive/jamcorder/firmware/esp-idf/components/esp_system/freertos_hooks.c:47 (discriminator 1)

0x40387975: prvIdleTask at /Volumes/User/MBP-Google-Drive/jamcorder/firmware/esp-idf/components/freertos/FreeRTOS-Kernel/tasks.c:4327

0x40386092: vPortTaskWrapper at /Volumes/User/MBP-Google-Drive/jamcorder/firmware/esp-idf/components/freertos/FreeRTOS-Kernel/portable/xtensa/port.c:162

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Comments: 33 (6 by maintainers)

Most upvoted comments

@chipweinberger Thanks for coming back with the confirmation, happy to hear it worked for you!

@chipweinberger Thanks for the details.

It is clearer now, the problem comes from the fact that between the moment you call esp_task_wdt_delete(xTaskGetIdleTaskHandleForCPU(x)) and the moment you call back esp_task_wdt_add(xTaskGetIdleTaskHandleForCPU(x)));, if the Idle task is run, you will get this issue because it tries to run its callback that resets the WDT (idle_hook_cb).

This happens now, in v5.1, since some changes in mmc code make it blocking by calling vTaskDelay, which will give the hand to the Idle task. While this may not be present in former versions, such as v4.4, you should not make the assumption that IDF functions (including esp_ds_sign, mbedtls_rsa_gen_key, mount_sdmmc, f_getfree) won’t give back the hand to the Idle task by calling vTaskDelay or any other blocking operation.

I see three solutions here:

  • Instead of deleting the Idle taks from the TWDT, reconfigure the latter so that it won’t watch the Idle tasks, and unsubscribe the callbacks:
esp_task_wdt_config_t config = {
    .timeout_ms = 60000,
    .trigger_panic = true,
    .idle_core_mask = 0, // i.e. do not watch any idle task
};
esp_err_t err = esp_task_wdt_reconfigure(&config);

you can then re-enable the WDT by calling esp_task_wdt_reconfigure again with .idle_core_mask equal to 3 (0b11)

  • Disable watching Idle core taks from the menuconfig and register your own task to watch thanks to esp_task_wdt_add() and esp_task_wdt_reset() (to feed), or your own entities with esp_task_wdt_add_user() and esp_task_wdt_reset_user()
  • Simply disable the TWDT from the menuconfig: if you cannot guarantee that your tasks will run within a certain delay, how to tell if the chip is stuck or if a heavy task is going on.