Page 1 of 1

ESP32 Reset loop after using reset pin

Posted: Fri Dec 02, 2022 11:38 pm
by chandrian31722
Hi all,
I am getting into a reset loop after using the reset pin on the ESP32. For some reason this was not happening on an old prototype and and it does not get into this state if my device is plugged into USB. Here is a error dump:

Guru Meditation Error: Core 1 panic'ed (IllegalInstruction). Exception was unhandled.
Memory dump at 0x400d9adc: f01d3a33 02502202 22a23333
Core 1 register dump:
PC : 0x400d9ae3 PS : 0x00060930 A0 : 0x4219d89e A1 : 0x3ffb1f30
A2 : 0x3ffc0328 A3 : 0x00000000 A4 : 0x00000010 A5 : 0x00000200
A6 : 0x00050723 A7 : 0x3ffb8058 A8 : 0x800d9ac2 A9 : 0x3ffb1f10
A10 : 0x0000004b A11 : 0x3adbc402 A12 : 0x0000155a A13 : 0x00003640
A14 : 0x20040902 A15 : 0x3ffb8058 SAR : 0x0000000a EXCCAUSE: 0x00000000
EXCVADDR: 0x00000000 LBEG : 0x40002390 LEND : 0x4000239f LCOUNT : 0x00000000

ELF file SHA256: 0000000000000000

Backtrace: 0x400d9ae3:0x3ffb1f30 0x4219d89b:0x3ffb1f50 0x400d4ca2:0x3ffb1f70 0x400d1dc8:0x3ffb1f90 0x400dc71d:0x3ffb1fb0 0x40086d4e:0x3ffb1fd0

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

rst:0xc (SW_CPU_RESET),boot:0x33 (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:1
load:0x3fff0018,len:4
load:0x3fff001c,len:1216
ho 0 tail 12 room 4
load:0x40078000,len:10944
load:0x40080400,len:6388
entry 0x400806b4
Guru Meditation Error: Core 0 panic'ed (StoreProhibited). Exception was unhandled.
Core 0 register dump:
PC : 0x400f55fb PS : 0x00060f33 A0 : 0x800f561a A1 : 0x3ffbc530
A2 : 0x00000001 A3 : 0x40083c38 A4 : 0x00060120 A5 : 0x3ffbbd70
A6 : 0x3ffc0d00 A7 : 0x3ffc0d04 A8 : 0x800f55ea A9 : 0x3ffbc510
A10 : 0x800f55ea A11 : 0x3ffbc53f A12 : 0x00000001 A13 : 0x00000001
A14 : 0x00060f20 A15 : 0x00000000 SAR : 0x00000000 EXCCAUSE: 0x0000001d
EXCVADDR: 0x800f55ee LBEG : 0x00000000 LEND : 0x00000000 LCOUNT : 0x00000000

ELF file SHA256: 0000000000000000

Backtrace: 0x400f55fb:0x3ffbc530 0x400f5617:0x3ffbc560 0x400f6105:0x3ffbc580 0x40088239:0x3ffbc5a0 0x40086d4e:0x3ffbc5c0

Re: ESP32 Reset loop after using reset pin

Posted: Sun Dec 04, 2022 6:06 am
by ESP_Sprite
Does the chip get enough power on the 3.3V rails?

Re: ESP32 Reset loop after using reset pin

Posted: Mon Dec 05, 2022 10:24 pm
by chandrian31722
It seems we were setting GPIO 12 high on startup cause the voltage to be regulated down to 1.8V. So do answer your question, no :D
Thanks for the reply

Re: ESP32 Reset loop after using reset pin

Posted: Tue Dec 06, 2022 4:27 am
by LittleRain
I'm having almost exact same issue, down to the old prototype working and the new one not.
Not sure if the OP was able to program it, but I'm unable to program via UART or JTAG.

I believe the problem has something to do with the flash, when trying to upload it can't detect flash size and defaults to 4mb, when I have a 16mb module.

My error is slightly different, seems the watch dog timer is causing the reset. Could it be due to no code being on the device?

Code: Select all

rst:0x10 (RTCWDT_RTC_RESET),boot:0x1f (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:0x3fffeba4,len:4
load:0x4009f000,len:3248
entry 0x4009f574
�OHAI�ets Jul 29 2019 12:21:46
I just noticed when I press reset, IO12 is jumping up to 3.5 - 3.8 volts, no idea why, its only connected to a JTAG header.
The weird part is when I release reset, IO12 has a 100khz signal (Edit: Actually 5Mhz, forgot I had it sampling at 500kHz before), I thought IO0 was only supposed to do that?
I'd like to try pulling IO12 down, but am worried the flash isn't 3.3V.
Does anyone know if the ESP32-WROVER-IE-N16R8 and/or ESP32-WROVER-E-N16R8 has 1.8V flash?

When I connect my JTAG programmer, IO12 is low during reset.
And so does that mean if you were using 1.8V flash, you couldn't safely program/debug via JTAG?

Re: ESP32 Reset loop after using reset pin

Posted: Tue Dec 06, 2022 5:12 pm
by chegewara

Code: Select all

rst:0x10 (RTCWDT_RTC_RESET),boot:0x1f (SPI_FAST_FLASH_BOOT)
https://docs.espressif.com/projects/esp ... ction.html
LittleRain wrote: When I connect my JTAG programmer, IO12 is low during reset.
And so does that mean if you were using 1.8V flash, you couldn't safely program/debug via JTAG?
(GPIO12) If driven High, flash voltage (VDD_SDIO) is 1.8V not default 3.3V. Has internal pull-down, so unconnected = Low = 3.3V. May prevent flashing and/or booting if 3.3V flash is used and this pin is pulled high, causing the flash to brownout. See the datasheet for more details.
You still should be able to flash with JTAG, but it wont run properly. You can burn efuse to set flash voltage and GPIO12 will be ignored.

Re: ESP32 Reset loop after using reset pin

Posted: Wed Dec 07, 2022 6:28 am
by LittleRain
Edit: Tried programming it with an example project using VisualGDB instead of VisualMicro/Arduino and it was able to program via JTAG. So looks like it is a software related problem.

Oh I forgot to mention if I press boot button it does go into UART boot mode.

I've tried programming with JTAG and its unable to.
The message I get is different every time, but its mostly the same, just longer or shorter.
I have no idea what I could do to fix the JTAG issue.

Code: Select all

Uploading 'ESP32_DHT11_Test' to 'ESP32 Wrover Module                                                                                                        (esp32_esp32wrover)' using 'Segger J-Link'
Uploader started for board ESP32 Wrover Module                                                                                                        (esp32_esp32wrover)
Uploader will use programmer name: espjlink
C:\ProgramData\vmicro\tools\openocd-espressif-esp32-10.0.1\bin\openocd.exe -d2 -s "C:\ProgramData\vmicro\tools\openocd-espressif-esp32-10.0.1/share/openocd/scripts/" -f "interface/jlink.cfg" -f "board/esp32-wrover.cfg" -c "echo -n {****[vMicro]**** Uploading App :}" -c "telnet_port disabled; program {C:\Users\...\AppData\Local\arduino15\packages\esp32\hardware\esp32\1.0.3/tools/partitions/boot_app0.bin} 0xe000" -c "echo -n {****[vMicro]**** Uploading Bootloader :}" -c "program {C:\Users\...\AppData\Local\Temp\VMBuilds\ESP32_DHT11_Test\esp32_esp32wrover\Release/ESP32_DHT11_Test.ino.bootloader.bin} 0x1000" -c "echo -n {****[vMicro]**** Uploading Sketch :}" -c "program {C:\Users\...\AppData\Local\Temp\VMBuilds\ESP32_DHT11_Test\esp32_esp32wrover\Release/ESP32_DHT11_Test.ino.bin} 0x10000" -c "echo -n {****[vMicro]**** Uploading Partitions :}" -c "program {C:\Users\...\AppData\Local\Temp\VMBuilds\ESP32_DHT11_Test\esp32_esp32wrover\Release/ESP32_DHT11_Test.ino.partitions.bin} 0x8000 reset; shutdown"
Open On-Chip Debugger  v0.10.0-esp32-20190313 (2019-03-13-09:57)
Licensed under GNU GPL v2
For bug reports, read
	http://openocd.org/doc/doxygen/bugs.html
debug_level: 2
adapter speed: 20000 kHz
Info : Configured 2 cores
esp32 interrupt mask on
****[vMicro]**** Uploading App :Info : J-Link ARM V8 compiled Nov 28 2014 13:44:46
Info : Hardware version: 8.00
Info : VTarget = 3.332 V
Info : Reduced speed from 20000 kHz to 12000 kHz (maximum).
Info : Reduced speed from 20000 kHz to 12000 kHz (maximum).
Info : clock speed 20000 kHz
Info : JTAG tap: esp32.cpu0 tap/device found: 0x120034e5 (mfg: 0x272 (Tensilica), part: 0x2003, ver: 0x1)
Info : JTAG tap: esp32.cpu1 tap/device found: 0x120034e5 (mfg: 0x272 (Tensilica), part: 0x2003, ver: 0x1)
Info : esp32: Debug controller 0 was reset (pwrstat=0x5F, after clear 0x0F).
Info : esp32: Core 0 was reset (pwrstat=0x5F, after clear 0x0F).
Info : Listening on port 3333 for gdb connections
Info : JTAG tap: esp32.cpu0 tap/device found: 0x120034e5 (mfg: 0x272 (Tensilica), part: 0x2003, ver: 0x1)
Info : JTAG tap: esp32.cpu1 tap/device found: 0x120034e5 (mfg: 0x272 (Tensilica), part: 0x2003, ver: 0x1)
Info : Target halted. PRO_CPU: PC=0x4009F626 (active)    APP_CPU: PC=0x00000000 
Error: cpu0: xtensa_write_memory (line 802): DSR (FFFFFFFF) indicates target still busy!
Error during upload using programmer
The uploader process failed

The uploader process failed
The uploader returned an error
Error: cpu0: xtensa_write_memory (line 802): DSR (FFFFFFFF) indicates DIR instruction generated an exception!
Error: cpu0: xtensa_write_memory (line 802): DSR (FFFFFFFF) indicates DIR instruction generated an overrun!
Warn : esp32: Failed writing 4 bytes at address 0x3ff48000, data - 00, 20, 49, 9c, 4c, 00, 00, 00
Error: xtensa_write_uint32_list: error writing to 3ff48000
Warn : esp32_soc_reset xtensa_write_uint32_list (reg_value_pairs_pre) err=-4
in procedure 'program'
embedded:startup.tcl:480: Error: ** Unable to reset target **
in procedure 'program' 
in procedure 'program_error' called at file "embedded:startup.tcl", line 505
at file "embedded:startup.tcl", line 480
Warn : Flash driver of esp32.flash does not support free_driver_priv()
Warn : Flash driver of irom does not support free_driver_priv()
Warn : Flash driver of drom does not support free_driver_priv()
Just tried again and I got something I've never seen before.

Code: Select all

Uploading 'Blink' to 'ESP32 Wrover Module                                                                                                        (esp32_esp32wrover)' using 'Segger J-Link'
Uploader started for board ESP32 Wrover Module                                                                                                        (esp32_esp32wrover)
Uploader will use programmer name: espjlink
C:\ProgramData\vmicro\tools\openocd-espressif-esp32-10.0.1\bin\openocd.exe -d2 -s "C:\ProgramData\vmicro\tools\openocd-espressif-esp32-10.0.1/share/openocd/scripts/" -f "interface/jlink.cfg" -f "board/esp32-wrover.cfg" -c "echo -n {****[vMicro]**** Uploading App :}" -c "telnet_port disabled; program {C:\Users\...\AppData\Local\arduino15\packages\esp32\hardware\esp32\1.0.3/tools/partitions/boot_app0.bin} 0xe000" -c "echo -n {****[vMicro]**** Uploading Bootloader :}" -c "program {C:\Users\...\AppData\Local\Temp\VMBuilds\Blink\esp32_esp32wrover\Release/Blink.ino.bootloader.bin} 0x1000" -c "echo -n {****[vMicro]**** Uploading Sketch :}" -c "program {C:\Users\...\AppData\Local\Temp\VMBuilds\Blink\esp32_esp32wrover\Release/Blink.ino.bin} 0x10000" -c "echo -n {****[vMicro]**** Uploading Partitions :}" -c "program {C:\Users\...\AppData\Local\Temp\VMBuilds\Blink\esp32_esp32wrover\Release/Blink.ino.partitions.bin} 0x8000 reset; shutdown"
Open On-Chip Debugger  v0.10.0-esp32-20190313 (2019-03-13-09:57)
Licensed under GNU GPL v2
For bug reports, read
	http://openocd.org/doc/doxygen/bugs.html
debug_level: 2
adapter speed: 20000 kHz
Info : Configured 2 cores
esp32 interrupt mask on
****[vMicro]**** Uploading App :Info : J-Link ARM V8 compiled Nov 28 2014 13:44:46
Info : Hardware version: 8.00
Info : VTarget = 3.332 V
Info : Reduced speed from 20000 kHz to 12000 kHz (maximum).
Info : Reduced speed from 20000 kHz to 12000 kHz (maximum).
Info : clock speed 20000 kHz
Error: JTAG scan chain interrogation failed: all ones
Error: Check JTAG interface, timings, target power, etc.
Error: Trying to use configured scan chain anyway...
Error: esp32.cpu0: IR capture error; saw 0x1f not 0x01
Warn : Bypassing JTAG setup events due to errors
Info : Listening on port 3333 for gdb connections
Error: JTAG scan chain interrogation failed: all ones
Error: Check JTAG interface, timings, target power, etc.
Error: Trying to use configured scan chain anyway...
Error: esp32.cpu0: IR capture error; saw 0x1f not 0x01
Warn : Bypassing JTAG setup events due to errors
Error during upload using programmer
The uploader process failed