ESP32 Exception Interrupt WDT Timeout

kurtisblow
Posts: 8
Joined: Fri Oct 23, 2020 6:41 am

ESP32 Exception Interrupt WDT Timeout

Postby kurtisblow » Thu Mar 17, 2022 6:54 am

Hi,

I'm using a ESP32 for some IoT with MQTT and it works pretty good so far, but around once a day the following occurs on each ESP32 (randomly) :

Meditation Error: Core 1 panic'ed (Interrupt wdt timeout on CPU1)

I'm not sure if this is caused by the logging process itself (will be disabled later) or if there is any other issues with MQTT/WiFi etc.

Error Decoded:

Code: Select all

0x4008cc8e: vListInsert at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/freertos/list.c line 188
0x4008b38e: uxPortCompareSet at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/freertos/tasks.c line 3507
:  (inlined by) vPortCPUAcquireMutexIntsDisabledInternal at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/freertos/portmux_impl.inc.h line 86
:  (inlined by) vPortCPUAcquireMutexIntsDisabled at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/freertos/portmux_impl.h line 98
:  (inlined by) vTaskEnterCritical at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/freertos/tasks.c line 4201
0x4008cc8e: vListInsert at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/freertos/list.c line 188
0x4008cc8e: vListInsert at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/freertos/list.c line 188
0x4008bea8: vTaskPlaceOnEventList at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/freertos/tasks.c line 3507
0x4008a1c3: xQueueGenericReceive at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/freertos/queue.c line 2038
0x400d524d: uartWriteBuf at C:\Users\PC\.platformio\packages\framework-arduinoespressif32\cores\esp32/esp32-hal-uart.c line 464
0x400d42b9: HardwareSerial::write(unsigned char const*, unsigned int) at C:\Users\PC\.platformio\packages\framework-arduinoespressif32\cores\esp32/HardwareSerial.cpp line 190
0x400d4502: Print::write(char const*) at C:\Users\PC\.platformio\packages\framework-arduinoespressif32\cores\esp32/Print.cpp line 261
0x400d45e5: Print::print(char const*) at C:\Users\PC\.platformio\packages\framework-arduinoespressif32\cores\esp32/Print.cpp line 261
0x400816db: solx1_timer_systick_puls_cb() at C:\Users\PC\ESP32\MQTT_ESP32_CLIENT V3/src/main.cpp line 1593
0x400819b5: __timerISR at C:\Users\PC\.platformio\packages\framework-arduinoespressif32\cores\esp32/esp32-hal-timer.c line 174
0x400879f9: _xt_lowint1 at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/freertos/xtensa_vectors.S line 1154
0x4008b4fd: vTaskExitCritical at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/freertos/tasks.c line 3507
0x4008a16f: xQueueGenericReceive at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/freertos/queue.c line 2038
0x400d524d: uartWriteBuf at C:\Users\PC\.platformio\packages\framework-arduinoespressif32\cores\esp32/esp32-hal-uart.c line 464
0x400d42b9: HardwareSerial::write(unsigned char const*, unsigned int) at C:\Users\PC\.platformio\packages\framework-arduinoespressif32\cores\esp32/HardwareSerial.cpp line 190
0x400d4502: Print::write(char const*) at C:\Users\PC\.platformio\packages\framework-arduinoespressif32\cores\esp32/Print.cpp line 261
0x400d45f9: Print::print(char const*) at C:\Users\PC\.platformio\packages\framework-arduinoespressif32\cores\esp32/Print.cpp line 261
:  (inlined by) Print::println() at C:\Users\PC\.platformio\packages\framework-arduinoespressif32\cores\esp32/Print.cpp line 183
0x400d462d: Print::println(char const*) at C:\Users\PC\.platformio\packages\framework-arduinoespressif32\cores\esp32/Print.cpp line 261
0x400811b9: solx1_mqtt_cb(char*, unsigned char*, unsigned int) at C:\Users\PC\ESP32\MQTT_ESP32_CLIENT V3/src/main.cpp line 1593
0x40142883: std::_Function_handler ::_M_invoke(std::_Any_data const&, char*&&, unsigned char*&&, unsigned int&&) at c:\users\PC\.platformio\packages\toolchain-xtensa32@2.50200.97\xtensa-esp32-elf\include\c++\5.2.0/functional line 1871
0x400d2892: std::function ::operator()(char*, unsigned char*, unsigned int) const at C:\Users\PC\ESP32\MQTT_ESP32_CLIENT V3/lib\PubSubClient\src/PubSubClient.cpp line 761
:  (inlined by) PubSubClient::loop() at C:\Users\PC\ESP32\MQTT_ESP32_CLIENT V3/lib\PubSubClient\src/PubSubClient.cpp line 416
0x400d1709: solx1_stm_wifi() at C:\Users\PC\ESP32\MQTT_ESP32_CLIENT V3/src/main.cpp line 1051
0x400d194d: loop() at C:\Users\PC\ESP32\MQTT_ESP32_CLIENT V3/src/main.cpp line 659
0x400d5799: loopTask(void*) at C:\Users\PC\.platformio\packages\framework-arduinoespressif32\cores\esp32/main.cpp line 23
0x4008a38a: vPortTaskWrapper at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/freertos/port.c line 355 (discriminator 1)
I'm unsure, how I should interpret this decoded error log, but it seems, that it has something to do with print() and the callback solx1_mqtt_cb(). So, is the print() in the callback responsible?

ESP_Dazz
Posts: 308
Joined: Fri Jun 02, 2017 6:50 am

Re: ESP32 Exception Interrupt WDT Timeout

Postby ESP_Dazz » Thu Mar 17, 2022 8:03 am

Are you attempting to call "println()` in an ISR (i.e., from the "solx1_timer_systick_puls_cb()"which in turn is called from the timer ISR)?

Judging from the log, you have some task calling "solx1_mqtt_cb()", which in turn calls "println()", which in turn takes UART Mutex lock.

While the lock is already taken, an interrupt occurs, and in the ISR calls "solx1_timer_systick_puls_cb()" which in turn attempts to "println()", which in turn attempts to take the mutex lock. But the mutex lock is already taken so you end up with a dead lock.

Try replacing all of the "println()` in ISRs with non-blocking prints (e.g., "#include/esp_rom_sys.h" "esp_rom_printf()") and see if the issue goes away.

Who is online

Users browsing this forum: No registered users and 120 guests