ESP32-DevKitC-32E constantly reboots without any user code in stack trace

greg-solargik
Posts: 12
Joined: Wed Aug 04, 2021 8:45 am

ESP32-DevKitC-32E constantly reboots without any user code in stack trace

Postby greg-solargik » Wed Aug 04, 2021 7:32 pm

Hello, I'm working with platformio, and the ESP32-DevKitC-32E board.
Here's my platformio.ini file:

Code: Select all


[env:esp32dev]
platform = espressif32
board = esp32dev
lib_deps = 
	bblanchon/ArduinoJson@^6.18.3
	rlogiacco/CircularBuffer@^1.3.3
	lasselukkari/aWOT@^3.4.0
	laurb9/StepperDriver@^1.3.1
	arduino-libraries/NTPClient@^3.1.0
monitor_speed = 115200
build_type = debug
monitor_filters = esp32_exception_decoder
build_flags = -DCORE_DEBUG_LEVEL=5
	
After uploading it I constantly get

Code: Select all

rst:0xc (SW_CPU_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3fff0018,len:4
load:0x3fff001c,len:1044
load:0x40078000,len:10124
load:0x40080400,len:5828
entry 0x400806a8
Guru Meditation Error: Core  0 panic'ed (LoadProhibited). Exception was unhandled.
Core 0 register dump:
PC      : 0x400f90c6  PS      : 0x00060130  A0      : 0x8008ab7e  A1      : 0x3ffe3ac0  
A2      : 0x3ffe3b9c  A3      : 0x00000010  A4      : 0x3f4172c8  A5      : 0x3ffb7e3c
A6      : 0x00000000  A7      : 0x00000000  A8      : 0x800f90b2  A9      : 0x03ffe3b9
A10     : 0xfe713278  A11     : 0x00000001  A12     : 0x00000001  A13     : 0x00000000  
A14     : 0x00000000  A15     : 0x00000000  SAR     : 0x00000017  EXCCAUSE: 0x0000001c
EXCVADDR: 0x800f90d6  LBEG    : 0x4000c2e0  LEND    : 0x4000c2f6  LCOUNT  : 0xffffffff  

ELF file SHA256: 0000000000000000

Backtrace: 0x400f90c6:0x3ffe3ac0 0x4008ab7b:0x3ffe3b80 0x400846a1:0x3ffe3bd0 0x40084830:0x3ffe3c20 0x40079247:0x3ffe3c40 0x400792ad:0x3ffe3c70 0x400792b8:0x3ffe3ca0 0x40079465:0x3ffe3cc0 0x400806da:0x3ffe3df0 0x40007c15:0x3ffe3eb0 0x4000073d:0x3ffe3f20
  #0  0x400f90c6:0x3ffe3ac0 in snprintf at /Users/ivan/e/newlib_xtensa-2.2.0-bin/newlib_xtensa-2.2.0/xtensa-esp32-elf/newlib/libc/stdio/../../../.././newlib/libc/stdio/snprintf.c:108  
  #1  0x4008ab7b:0x3ffe3b80 in vTaskStartScheduler at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/freertos/tasks.c:3507
  #2  0x400846a1:0x3ffe3bd0 in start_cpu0_default at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/esp32/cpu_start.c:460
  #3  0x40084830:0x3ffe3c20 in call_start_cpu0 at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/esp32/cpu_start.c:262
  #4  0x40079247:0x3ffe3c40 in ?? ??:0
  #5  0x400792ad:0x3ffe3c70 in ?? ??:0
  #6  0x400792b8:0x3ffe3ca0 in ?? ??:0
  #7  0x40079465:0x3ffe3cc0 in ?? ??:0
  #8  0x400806da:0x3ffe3df0 in ?? ??:0
  #9  0x40007c15:0x3ffe3eb0 in ?? ??:0
  #10 0x4000073d:0x3ffe3f20 in ?? ??:0
 
It looks like my code doesn't start getting executed at all...
I have managed to run basic sketches on the board.

Any help would be appreciated.

greg-solargik
Posts: 12
Joined: Wed Aug 04, 2021 8:45 am

Re: ESP32-DevKitC-32E constantly reboots without any user code in stack trace

Postby greg-solargik » Sat Aug 07, 2021 7:52 am

Just to let you know, the problem went away after I installed the devkit in a breadboard.
I would appreciate an explanation as to why this happens.

ESP_Sprite
Posts: 9709
Joined: Thu Nov 26, 2015 4:08 am

Re: ESP32-DevKitC-32E constantly reboots without any user code in stack trace

Postby ESP_Sprite » Mon Aug 09, 2021 12:50 am

Probably a power supply issue. If you supply too little current to an ESP32, it'll crash somewhere, usually when you try to bring up WiFi but possibly earlier, dependent on how throttled the supply is.

greg-solargik
Posts: 12
Joined: Wed Aug 04, 2021 8:45 am

Re: ESP32-DevKitC-32E constantly reboots without any user code in stack trace

Postby greg-solargik » Mon Aug 09, 2021 4:38 am

Well, in both cases it was powered by the same PC from a USB port…

greg-solargik
Posts: 12
Joined: Wed Aug 04, 2021 8:45 am

Re: ESP32-DevKitC-32E constantly reboots without any user code in stack trace

Postby greg-solargik » Mon Aug 09, 2021 8:00 am

The problem still happens (maybe slightly different exception)

Code: Select all

Rebooting...
ets Jul 29 2019 12:21:46

rst:0xc (SW_CPU_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3fff0018,len:4
load:0x3fff001c,len:1044
load:0x40078000,len:10124
load:0x40080400,len:5828
entry 0x400806a8
Guru Meditation Error: Core  0 panic'ed (InstrFetchProhibited). Exception was unhandled.
Core 0 register dump:
PC      : 0x100005f0  PS      : 0x00060130  A0      : 0x8010e711  A1      : 0x3ffe37b0
A2      : 0x3ffb7e3c  A3      : 0x3ffe3ac0  A4      : 0x3f41a37c  A5      : 0x3ffe3b60  
A6      : 0x3ffe3b40  A7      : 0x0000000c  A8      : 0x8010fb95  A9      : 0x3ffe3790
A10     : 0x3ff9c50f  A11     : 0x3f432900  A12     : 0x00000000  A13     : 0x3ffbbc00  
A14     : 0xb33fffff  A15     : 0x00000000  SAR     : 0x00000017  EXCCAUSE: 0x00000014
EXCVADDR: 0x100005f0  LBEG    : 0x4000c2e0  LEND    : 0x4000c2f6  LCOUNT  : 0xffffffff  

ELF file SHA256: 0000000000000000

Backtrace: 0x100005f0:0x3ffe37b0 0x4010e70e:0x3ffe3ac0 0x4008abef:0x3ffe3b80 0x40084715:0x3ffe3bd0 0x400848a4:0x3ffe3c20 0x40079247:0x3ffe3c40 0x400792ad:0x3ffe3c70 0x400792b8:0x3ffe3ca0 0x40079465:0x3ffe3cc0 0x400806da:0x3ffe3df0 0x40007c15:0x3ffe3eb0 0x4000073d:0x3ffe3f20
  #0  0x100005f0:0x3ffe37b0 in ?? ??:0
  #1  0x4010e70e:0x3ffe3ac0 in snprintf at /Users/ivan/e/newlib_xtensa-2.2.0-bin/newlib_xtensa-2.2.0/xtensa-esp32-elf/newlib/libc/stdio/../../../.././newlib/libc/stdio/snprintf.c:116  
  #2  0x4008abef:0x3ffe3b80 in vTaskStartScheduler at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/freertos/tasks.c:3507
  #3  0x40084715:0x3ffe3bd0 in start_cpu0_default at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/esp32/cpu_start.c:460
  #4  0x400848a4:0x3ffe3c20 in call_start_cpu0 at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/esp32/cpu_start.c:262
  #5  0x40079247:0x3ffe3c40 in ?? ??:0
  #6  0x400792ad:0x3ffe3c70 in ?? ??:0
  #7  0x400792b8:0x3ffe3ca0 in ?? ??:0
  #8  0x40079465:0x3ffe3cc0 in ?? ??:0
  #9  0x400806da:0x3ffe3df0 in ?? ??:0
  #10 0x40007c15:0x3ffe3eb0 in ?? ??:0
  #11 0x4000073d:0x3ffe3f20 in ?? ??:0

It does depend on the code I'm executing, it seems the compiler generates some kind of bad image which crashes the cpu.
Any ideas?
Any ideas?

ESP_Sprite
Posts: 9709
Joined: Thu Nov 26, 2015 4:08 am

Re: ESP32-DevKitC-32E constantly reboots without any user code in stack trace

Postby ESP_Sprite » Mon Aug 09, 2021 2:10 pm

Again, possibly a power supply problem... can you see if a different (thicker) USB cable fixes it? Alternatively, using a powered hub may also work around this issue sometimes.

greg-solargik
Posts: 12
Joined: Wed Aug 04, 2021 8:45 am

Re: ESP32-DevKitC-32E constantly reboots without any user code in stack trace

Postby greg-solargik » Sun Aug 22, 2021 12:13 pm

Sorry for the long time without a response.
This started happening to me again, just having code using the Update class causes this to happen, again, the actual code is not called at all.
Tried multiple different micro-usb cables, same result. Using with & without powered docking station - again, no change in behavior. Commenting out the code related to the Update class - all works as expected

When I power the devkit-c via a lab power supply using 9V, I have no way to know what's the terminal output, but the wifi doesn't seem to be initialized on the board as well (no ping).

Any ideas?

greg-solargik
Posts: 12
Joined: Wed Aug 04, 2021 8:45 am

Re: ESP32-DevKitC-32E constantly reboots without any user code in stack trace

Postby greg-solargik » Sun Aug 22, 2021 1:29 pm

Managed to get around this by removing the

Code: Select all

CORE_DEBUG_LEVEL=5
define.
Can anyone provide a pointer?

ESP_Sprite
Posts: 9709
Joined: Thu Nov 26, 2015 4:08 am

Re: ESP32-DevKitC-32E constantly reboots without any user code in stack trace

Postby ESP_Sprite » Mon Aug 23, 2021 2:05 am

Is CORE_DEBUG_LEVEL something specific to PlatformIO or your own code? It doesn't appear in ESP-IDF.

greg-solargik
Posts: 12
Joined: Wed Aug 04, 2021 8:45 am

Re: ESP32-DevKitC-32E constantly reboots without any user code in stack trace

Postby greg-solargik » Mon Aug 23, 2021 6:32 am

During troubleshooting of those issues I followed the guides of ESP32 debugging from PlatformIO, e.g. from https://community.platformio.org/t/how- ... esp32/8278
I added it to my platformio configuration as an additional define.
I see that other people have issues with the flag, e.g. https://github.com/espressif/arduino-esp32/issues/2025

Who is online

Users browsing this forum: No registered users and 90 guests