Page 1 of 1

Interrupt watchdog timer firing

Posted: Sat Jan 22, 2022 4:49 pm
by rickwise
I'm trying to make a simple switch to trigger a home automation script.
I have a Hiletgo ESP-WROOM-32 ESP32 ESP-32S. The board says nodemcu and esp-32s on the bottom.
I tried choosing board NodeMCU-32S, and Node32s (the latter based on the Hiletgo site), same behavior.
I'm using Arduino IDE version 1.8.16 on Win10.
I have version 1.0.6 of the esp board pack.
I stripped down the code to nothing but setup and an empty loop(), and it still crashes.
When I run this code:
  1. #include <WiFi.h>
  2. #include "arduino_secrets.h"
  3.  
  4. char    ssid[] = SECRET_SSID_MAIN;
  5. char    password[] = SECRET_PASS;
  6.  
  7. void setup() {
  8.  
  9.   Serial.begin(115200);
  10.   while( ! Serial)
  11.     {;}
  12.  
  13.   WiFi.begin(ssid, password);
  14.  
  15.   int ntries = 100;
  16.   while (ntries-- > 0 && WiFi.status() != WL_CONNECTED) {
  17.     delay(50);
  18.     Serial.print(".");
  19.   }
  20.   Serial.println(ntries);
  21. }
  22.  
  23. void loop() {
  24.  
  25.  
  26. }
I see this in the serial monitor:
..........................................................41
Guru Meditation Error: Core panic'ed (Interrupt wdt timeout on CPU0)
Core 0 register dump:
PC 0x40081640 PS 0x00060034 A0 0x80081860 A1 0x3fb830
A2 0x4012bb A3 0x00000001 A4 0x0000000e A5 0x3fb310
A6 0x400881f A7 0x40086834 A8 0x8008163c A9 0x3fb810
A10 0x0000000a A11 0x3fb830 A12 0x0000000a A13 0x3fb650
A14 0x3fc2a A15 0x000006a SAR 0x0000001a EXCCAUSE 0x00000005
EXCVADDR 0x00000000 LBEG 0x4000c6c LEND 0x4000c77 LCOUNT 0x00000000
Core was running in ISR context:
EPC1 : 0x400f327 EPC2 : 0x00000000 EPC3 : 0x00000000 EPC4 : 0x40081640

ELF file SHA256: 000000000000000

Backtrace:0x40081640:0x3fb8300x4008185d0x3fb8600x40086e1:0x3fb8900x400f324:0x3fb6b 0x40105381:0x3fb6e 0x40100a2:0x3fb760 0x40089792:0x3fb790

ore 1 register dump:
PC 0x400d78b PS 0x00060834 A0 0x80089795 A1 0x3fbf0
A2 0x3fc814 A3 0x00000000 A4 0x00060023 A5 0x3fbc4
A6 0x00000000 A7 0x00000000 A8 0x00000000 A9 0x3fbf0
A10 0x3fc7c A11 0x00000029 A12 0x00000020 A13 0x80000020
A14 0x00000003 A15 0x00060a3 SAR 0x00000018 EXCCAUSE 0x00000005
EXCVADDR 0x00000000 LBEG 0x400014f LEND 0x4000150d LCOUNT 0xffff

ELF file SHA256: 000000000000000

Backtrace:0x400d78b0x3fbf00x40089792:0x3fbf0

Rebooting...
I've run some ESP32 cameras using the Arduino IDE. This is my first try at a regular ESP32 board.

Any ideas? :?

Re: Interrupt watchdog timer firing

Posted: Sun Jan 23, 2022 2:14 am
by ESP_Sprite
You could try and decode that stack trace, it may give you some more info.

Re: Interrupt watchdog timer firing

Posted: Tue Jan 25, 2022 5:34 pm
by rickwise
ESP_Sprite, I decoded the backtrace, got:
0x40089792: vPortReleaseTaskMPUSettings at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/freertos/port.c line 323
I can't find a file named port.c in my system, should I be looking in github or something?

Re: Interrupt watchdog timer firing

Posted: Thu Jan 27, 2022 7:42 am
by ESP_Sprite
That looks like a red herring, honestly. Can you decode the backtrace of CPU0 as well? (It's a bit higher up in your log.)

Re: Interrupt watchdog timer firing

Posted: Thu Jan 27, 2022 12:23 pm
by rickwise
Decode of the first stack trace (
Backtrace:0x40081640:0x3fb8300x4008185d0x3fb8600x40086e1:0x3fb8900x400f324:0x3fb6b 0x40105381:0x3fb6e 0x40100a2:0x3fb760 0x40089792:0x3fb790
) gives:
0x40089792: vPortTaskWrapper at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/freertos/port.c line 143
Decode of the second (
Backtrace:0x400d78b0x3fbf00x40089792:0x3fbf0
) gives the same:
0x40089792: vPortTaskWrapper at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/freertos/port.c line 143
This is strange, because the traces are quite different. Perhaps I'm doing something wrong.

I opened the IDE, chose the right board, and compiled the sketch. I opened the decoder and pasted in CPU0 backtrace. Then I closed the IDE, opened it back up, compiled the sketch, and pasted in the CPU1 backtrace.

Re: Interrupt watchdog timer firing

Posted: Fri Jan 28, 2022 2:54 am
by ESP_Sprite
Erm... that stack trace should decode to a whole bunch of lines; is that all you're getting?

Re: Interrupt watchdog timer firing

Posted: Fri Jan 28, 2022 3:41 pm
by rickwise
ESP_Sprite, I may have the answer, although I don't understand it.

I wanted to cause a fresh crash to make sure I copied everything. I connected the board and uploaded the sketch, and it didn't fail, after hours of spinning. So I suspected the USB cable, and swapped back to one that I was using before, and it crashed. I also noticed that there are missing characters in the crash dump (even the first one I posted). Instead of "Core 1" for the second section, it says "ore 1".

The cable that fails is 5 feet, the one that works is 1 foot long. I don't know why that would make a difference, but the 5-foot cable may also not be as good. I used a USB tester on it, and it appears fine, but that tells nothing about frequency handling.

I'll keep digging on the cable front.

Re: Interrupt watchdog timer firing

Posted: Sat Jan 29, 2022 2:45 am
by ESP_Sprite
Could be a power issue. The ESP32 boards have a somewhat spikey power usage pattern, and not all USB cables play nicely with it. Loss of power can make the ESP32 crash.

Re: Interrupt watchdog timer firing

Posted: Sat Jan 29, 2022 1:35 pm
by rickwise
You could be right. I checked, and the cable that worked has a resistance of 0.117 ohms on the V+ line, whereas the one with problems is 0.420.