Task watchdog getting triggered.

alitergee
Posts: 14
Joined: Wed Aug 17, 2022 1:31 pm

Task watchdog getting triggered.

Postby alitergee » Fri Aug 19, 2022 12:31 pm

Hello,

I'm new to ESP32 and ESP-IDF and I'm working on a project that has stuff like modbus, spiffs, wifi, mqtt, etc.
Somehow while running any of the task, Task watchdog is getting triggred. Like follows

Code: Select all

E (7773) task_wdt: Task watchdog got triggered. The following tasks did not reset the watchdog in time:
E (7773) task_wdt:  - IDLE (CPU 0)
E (7773) task_wdt: Tasks currently running:
E (7773) task_wdt: CPU 0: ipc0
E (7773) task_wdt: CPU 1: IDLE
E (7773) task_wdt: Print CPU 0 (current core) backtrace


Backtrace:0x400FCB0E:0x3FFB0B800x40082D59:0x3FFB0BA0 0x4000BFED:0x3FFAFA50 0x4008DDAA:0x3FFAFA60 0x40082293:0x3FFAFA80 0x40084E72:0x3FFAFAA0 0x4008327A:0x3FFAFAC0 0x4008DAF9:0x3FFAFAE0 

E (7773) task_wdt: Print CPU 1 backtrace


Backtrace:0x40086271:0x3FFB11800x40082D59:0x3FFB11A0 0x4000BFED:0x3FFBEC40 0x4008DDAA:0x3FFBEC50 0x400FCDD3:0x3FFBEC70 0x400FCDDF:0x3FFBECA0 0x400D4725:0x3FFBECC0 0x4008BF45:0x3FFBECE0 0x4008DAF9:0x3FFBED00

Code: Select all

E (12853) task_wdt: Task watchdog got triggered. The following tasks did not reset the watchdog in time:
E (12853) task_wdt:  - IDLE (CPU 0)
E (12853) task_wdt: Tasks currently running:
E (12853) task_wdt: CPU 0: spiffs_task
E (12853) task_wdt: CPU 1: IDLE
E (12853) task_wdt: Print CPU 0 (current core) backtrace


Backtrace:0x400FCB0E:0x3FFB0B800x40082D59:0x3FFB0BA0 0x40084FA0:0x3FFD9F60 0x40086099:0x3FFD9F80 0x400860A5:0x3FFD9FA0 0x40088B49:0x3FFD9FC0 0x40085CF9:0x3FFD9FE0 0x400F8D41:0x3FFDA020 0x400EA6E9:0x3FFDA050 0x400EE20F:0x3FFDA080 0x400EBE3F:0x3FFDA0B0 0x400EC1D1:0x3FFDA0F0 0x400EC21B:0x3FFDA120 0x400EC4BE:0x3FFDA140 0x400EC99A:0x3FFDA180 0x400EB690:0x3FFDA1D0 0x400EA2F1:0x3FFDA210 0x400EA36E:0x3FFDA260 0x400D5319:0x3FFDA280 0x4017298C:0x3FFDA2A0 0x40172A35:0x3FFDA2D0 0x400DD7EE:0x3FFDA2F0 0x4008DAF9:0x3FFDA370 

E (12853) task_wdt: Print CPU 1 backtrace


Backtrace:0x40086271:0x3FFB11800x40082D59:0x3FFB11A0 0x4000BFED:0x3FFBEC40 0x4008DDAA:0x3FFBEC50 0x400FCDD3:0x3FFBEC70 0x400FCDDF:0x3FFBECA0 0x400D4725:0x3FFBECC0 0x4008BF45:0x3FFBECE0 0x4008DAF9:0x3FFBED00

Code: Select all

SPIFFS CURRENT used_mem : 3835531 of TOTAL : 7703441
E (12813) task_wdt: Task watchdog got triggered. The following tasks did not reset the watchdog in time:
E (12813) task_wdt:  - IDLE (CPU 0)
E (12813) task_wdt: Tasks currently running:
E (12813) task_wdt: CPU 0: wifi
E (12813) task_wdt: CPU 1: IDLE
E (12813) task_wdt: Print CPU 0 (current core) backtrace


Backtrace:0x400FCB0E:0x3FFB0B800x40082D59:0x3FFB0BA0 0x4000BFED:0x3FFC6960 0x4008DDAA:0x3FFC6970 0x401404EB:0x3FFC6990 0x40140521:0x3FFC69B0 0x4013C7B4:0x3FFC69D0 0x4013C856:0x3FFC69F0 0x40136A0E:0x3FFC6A10 0x40136C99:0x3FFC6A30 0x40137815:0x3FFC6A90 0x40100E29:0x3FFC6B50 0x40169AC1:0x3FFC6B90 0x40169C4B:0x3FFC6BB0 0x40163FC6:0x3FFC6C60 0x40163FDC:0x3FFC6CA0 0x40156F55:0x3FFC6CC0 0x40157456:0x3FFC6D00 0x40158215:0x3FFC6D50 0x40158298:0x3FFC6DD0 0x40151F4C:0x3FFC6E20 0x40152437:0x3FFC6E70 0x4015694D:0x3FFC6EA0 0x4015696E:0x3FFC6EC0 0x40156494:0x3FFC6EE0 0x40156719:0x3FFC6F00 0x400938B5:0x3FFC6F20 0x4008DAF9:0x3FFC6F50 

E (12813) task_wdt: Print CPU 1 backtrace


Backtrace:0x40086271:0x3FFB11800x40082D59:0x3FFB11A0 0x4000BFED:0x3FFBEC40 0x4008DDAA:0x3FFBEC50 0x400FCDD3:0x3FFBEC70 0x400FCDDF:0x3FFBECA0 0x400D4725:0x3FFBECC0 0x4008BF45:0x3FFBECE0 0x4008DAF9:0x3FFBED00 
May I know why these tasks are triggered and how to eliminate them?
Note : Each of the task has minimum of (50/ portTICK_PERIOD_MS) delay.

Please Help. Thank you.

ccrause
Posts: 15
Joined: Wed Feb 27, 2019 7:42 am

Re: Task watchdog getting triggered.

Postby ccrause » Mon Aug 22, 2022 11:53 am

To start, convert the backtrace to source code locations, this way you can at least see more or less where in your code the timeout occurs. See this excellent post on how to convert the code addresses (0x40...) to source code locations: https://esp32.com/viewtopic.php?t=263#p1131

After doing this you will have some clues on where to look for loops, busy waits and other potentially time consuming code that may need a vTaskDelay to yield (if the current code can yield) or esp_task_wdt_reset (if the current code cannot yield).

alitergee
Posts: 14
Joined: Wed Aug 17, 2022 1:31 pm

Re: Task watchdog getting triggered.

Postby alitergee » Mon Aug 22, 2022 1:59 pm

Thank you so much I will look into it.

alitergee
Posts: 14
Joined: Wed Aug 17, 2022 1:31 pm

Re: Task watchdog getting triggered.

Postby alitergee » Tue Aug 23, 2022 9:43 am

ccrause wrote:
Mon Aug 22, 2022 11:53 am
To start, convert the backtrace to source code locations, this way you can at least see more or less where in your code the timeout occurs. See this excellent post on how to convert the code addresses (0x40...) to source code locations: https://esp32.com/viewtopic.php?t=263#p1131

Getting source code locations like following

Code: Select all

0x400fa7b6: task_wdt_isr at C:/Espressif/frameworks/esp-idf-v4.4.1/components/esp_system/task_wdt.c:183 (discriminator 3)

0x40082d41: _xt_lowint1 at C:/Espressif/frameworks/esp-idf-v4.4.1/components/freertos/port/xtensa/xtensa_vectors.S:1111

0x4008dc56: vPortClearInterruptMaskFromISR at C:/Espressif/frameworks/esp-idf-v4.4.1/components/freertos/port/xtensa/include/freertos/portmacro.h:571
 (inlined by) vPortExitCritical at C:/Espressif/frameworks/esp-idf-v4.4.1/components/freertos/port/xtensa/port.c:319

0x4008227b: vPortExitCriticalSafe at C:/Espressif/frameworks/esp-idf-v4.4.1/components/freertos/port/xtensa/include/freertos/portmacro.h:607
 (inlined by) esp_intr_noniram_enable at C:/Espressif/frameworks/esp-idf-v4.4.1/components/esp_hw_support/intr_alloc.c:808

0x40084e5a: spi_flash_op_block_func at C:/Espressif/frameworks/esp-idf-v4.4.1/components/spi_flash/cache_utils.c:129

0x40083262: ipc_task at C:/Espressif/frameworks/esp-idf-v4.4.1/components/esp_ipc/src/esp_ipc.c:74

0x4008d9a5: vPortTaskWrapper at C:/Espressif/frameworks/esp-idf-v4.4.1/components/freertos/port/xtensa/port.c:131

0x40086259: esp_crosscore_isr at C:/Espressif/frameworks/esp-idf-v4.4.1/components/esp_system/crosscore_int.c:92

0x40082d41: _xt_lowint1 at C:/Espressif/frameworks/esp-idf-v4.4.1/components/freertos/port/xtensa/xtensa_vectors.S:1111

0x4008dc56: vPortClearInterruptMaskFromISR at C:/Espressif/frameworks/esp-idf-v4.4.1/components/freertos/port/xtensa/include/freertos/portmacro.h:571
 (inlined by) vPortExitCritical at C:/Espressif/frameworks/esp-idf-v4.4.1/components/freertos/port/xtensa/port.c:319

0x400faa7b: esp_task_wdt_reset at C:/Espressif/frameworks/esp-idf-v4.4.1/components/esp_system/task_wdt.c:330

0x400faa87: idle_hook_cb at C:/Espressif/frameworks/esp-idf-v4.4.1/components/esp_system/task_wdt.c:80

0x400d4625: esp_vApplicationIdleHook at C:/Espressif/frameworks/esp-idf-v4.4.1/components/esp_system/freertos_hooks.c:51 (discriminator 1)

0x4008beb9: prvIdleTask at C:/Espressif/frameworks/esp-idf-v4.4.1/components/freertos/tasks.c:3973 (discriminator 1)

0x4008d9a5: vPortTaskWrapper at C:/Espressif/frameworks/esp-idf-v4.4.1/components/freertos/port/xtensa/port.c:131

0x400fa7b6: task_wdt_isr at C:/Espressif/frameworks/esp-idf-v4.4.1/components/esp_system/task_wdt.c:183 (discriminator 3)

0x40082d41: _xt_lowint1 at C:/Espressif/frameworks/esp-idf-v4.4.1/components/freertos/port/xtensa/xtensa_vectors.S:1111

0x4008dc56: vPortClearInterruptMaskFromISR at C:/Espressif/frameworks/esp-idf-v4.4.1/components/freertos/port/xtensa/include/freertos/portmacro.h:571
 (inlined by) vPortExitCritical at C:/Espressif/frameworks/esp-idf-v4.4.1/components/freertos/port/xtensa/port.c:319

0x4008227b: vPortExitCriticalSafe at C:/Espressif/frameworks/esp-idf-v4.4.1/components/freertos/port/xtensa/include/freertos/portmacro.h:607
 (inlined by) esp_intr_noniram_enable at C:/Espressif/frameworks/esp-idf-v4.4.1/components/esp_hw_support/intr_alloc.c:808

0x40084e5a: spi_flash_op_block_func at C:/Espressif/frameworks/esp-idf-v4.4.1/components/spi_flash/cache_utils.c:129

0x40083262: ipc_task at C:/Espressif/frameworks/esp-idf-v4.4.1/components/esp_ipc/src/esp_ipc.c:74

0x4008d9a5: vPortTaskWrapper at C:/Espressif/frameworks/esp-idf-v4.4.1/components/freertos/port/xtensa/port.c:131

0x40086259: esp_crosscore_isr at C:/Espressif/frameworks/esp-idf-v4.4.1/components/esp_system/crosscore_int.c:92

0x40082d41: _xt_lowint1 at C:/Espressif/frameworks/esp-idf-v4.4.1/components/freertos/port/xtensa/xtensa_vectors.S:1111

0x4008dc56: vPortClearInterruptMaskFromISR at C:/Espressif/frameworks/esp-idf-v4.4.1/components/freertos/port/xtensa/include/freertos/portmacro.h:571
 (inlined by) vPortExitCritical at C:/Espressif/frameworks/esp-idf-v4.4.1/components/freertos/port/xtensa/port.c:319

0x400faa7b: esp_task_wdt_reset at C:/Espressif/frameworks/esp-idf-v4.4.1/components/esp_system/task_wdt.c:330

0x400faa87: idle_hook_cb at C:/Espressif/frameworks/esp-idf-v4.4.1/components/esp_system/task_wdt.c:80

0x400d4625: esp_vApplicationIdleHook at C:/Espressif/frameworks/esp-idf-v4.4.1/components/esp_system/freertos_hooks.c:51 (discriminator 1)

0x4008beb9: prvIdleTask at C:/Espressif/frameworks/esp-idf-v4.4.1/components/freertos/tasks.c:3973 (discriminator 1)

0x4008d9a5: vPortTaskWrapper at C:/Espressif/frameworks/esp-idf-v4.4.1/components/freertos/port/xtensa/port.c:131

0x400fa7b6: task_wdt_isr at C:/Espressif/frameworks/esp-idf-v4.4.1/components/esp_system/task_wdt.c:183 (discriminator 3)

0x40082d41: _xt_lowint1 at C:/Espressif/frameworks/esp-idf-v4.4.1/components/freertos/port/xtensa/xtensa_vectors.S:1111

0x4008dc56: vPortClearInterruptMaskFromISR at C:/Espressif/frameworks/esp-idf-v4.4.1/components/freertos/port/xtensa/include/freertos/portmacro.h:571
 (inlined by) vPortExitCritical at C:/Espressif/frameworks/esp-idf-v4.4.1/components/freertos/port/xtensa/port.c:319

0x4008227b: vPortExitCriticalSafe at C:/Espressif/frameworks/esp-idf-v4.4.1/components/freertos/port/xtensa/include/freertos/portmacro.h:607
 (inlined by) esp_intr_noniram_enable at C:/Espressif/frameworks/esp-idf-v4.4.1/components/esp_hw_support/intr_alloc.c:808

0x40084e5a: spi_flash_op_block_func at C:/Espressif/frameworks/esp-idf-v4.4.1/components/spi_flash/cache_utils.c:129

0x40083262: ipc_task at C:/Espressif/frameworks/esp-idf-v4.4.1/components/esp_ipc/src/esp_ipc.c:74

0x4008d9a5: vPortTaskWrapper at C:/Espressif/frameworks/esp-idf-v4.4.1/components/freertos/port/xtensa/port.c:131

0x40086259: esp_crosscore_isr at C:/Espressif/frameworks/esp-idf-v4.4.1/components/esp_system/crosscore_int.c:92

0x40082d41: _xt_lowint1 at C:/Espressif/frameworks/esp-idf-v4.4.1/components/freertos/port/xtensa/xtensa_vectors.S:1111

0x4008dc56: vPortClearInterruptMaskFromISR at C:/Espressif/frameworks/esp-idf-v4.4.1/components/free0x400d4625: esp_vApplicationIdleHook at C:/Espressif/frameworks/esp-idf-v4.4.1/components/esp_system/freertos_hooks.c:51 (discriminator 1)

0x4008beb9: prvIdleTask at C:/Espressif/frameworks/esp-idf-v4.4.1/components/freertos/tasks.c:3973 (discriminator 1)

0x4008d9a5: vPortTaskWrapper at C:/Espressif/frameworks/esp-idf-v4.4.1/components/freertos/port/xtensa/port.c:131

which are all in build EDS-IDF files. I Couldn't conclude anything from them.
Please help?

Who is online

Users browsing this forum: Baidu [Spider], MicroController and 213 guests