ESP32S2 board resetting from deep sleep
Posted: Tue Jan 19, 2021 5:14 pm
I have a problem that is stumping me... I have an ESP32S2 board which uses the ESP32S2 WROOM module.
After I put the ESP32S2 into deep sleep, on MOST boards (I've got one magic one that doesn't repro), after a while, the CPU will randomly reset. I've double checked the esp_reset_reason(), and it returns power on (as you can see from the dump below).
My assumptions were that there was either a power problem or something funky on the EN pin. I've put both of them on the scope and I never see ANY drop at all. They're both ROCK solid, even while the problem is reproducing over and over again, so I feel like it isn't that.
One interesting thing is that it seems to take a while the first sleep. It will sleep for 5-30 seconds the first time before resetting, but then after that it happens quite quickly. Sometimes it's immediate, looks like under a second, and sometimes it takes a couple seconds, but never nearly as long as the first time. That kind of makes me think of a charge building up on something, or a capacitor draining and never getting recharged... But for the life of me, I can't figure out what.
There are only a few pins on the ESP32S2-WROOM that are connected:
GPIO0 - Reset circuit
GPIO8 (ADC1_CH7) - Battery voltage divider
GPIO13 - Touch pad (for wakeup)
GPIO18 - Data line to HX711 ADC
GPIO19 - SCK line to HX711 ADC
GPIO20, 21, 26 - RGB lines to an RGB LED (common anode)
GPIO43 (U0TXD) - Serial converter
GPIO44 (U0RXD) - Serial converter
3.3V, GND
The rest of the pins are not connected.
Thanks,
- Scott
After I put the ESP32S2 into deep sleep, on MOST boards (I've got one magic one that doesn't repro), after a while, the CPU will randomly reset. I've double checked the esp_reset_reason(), and it returns power on (as you can see from the dump below).
My assumptions were that there was either a power problem or something funky on the EN pin. I've put both of them on the scope and I never see ANY drop at all. They're both ROCK solid, even while the problem is reproducing over and over again, so I feel like it isn't that.
One interesting thing is that it seems to take a while the first sleep. It will sleep for 5-30 seconds the first time before resetting, but then after that it happens quite quickly. Sometimes it's immediate, looks like under a second, and sometimes it takes a couple seconds, but never nearly as long as the first time. That kind of makes me think of a charge building up on something, or a capacitor draining and never getting recharged... But for the life of me, I can't figure out what.
There are only a few pins on the ESP32S2-WROOM that are connected:
GPIO0 - Reset circuit
GPIO8 (ADC1_CH7) - Battery voltage divider
GPIO13 - Touch pad (for wakeup)
GPIO18 - Data line to HX711 ADC
GPIO19 - SCK line to HX711 ADC
GPIO20, 21, 26 - RGB lines to an RGB LED (common anode)
GPIO43 (U0TXD) - Serial converter
GPIO44 (U0RXD) - Serial converter
3.3V, GND
The rest of the pins are not connected.
Any ideas? Any thoughts about what could be causing it to Reset from deep sleep?I (5417) Sleep: Enabling timer wakeup, 86400s
I (5517) Sleep: test init: touch pad [13] slp 7546, thresh 754
I (5517) Sleep: Enabling touch pad wakeup
I (5517) Sleep: Entering deep sleep
ESP-ROM:esp32s2-rc4-20191025
Build:Oct 25 2019
rst:0x1 (POWERON),boot:0x8 (SPI_FAST_FLASH_BOOT)
SPIWP:0xee
mode:DIO, clock div:1
load:0x3ffe6100,len:0x8
load:0x3ffe6108,len:0x14f4
load:0x4004c000,len:0x9d8
load:0x40050000,len:0x2e34
entry 0x4004c1ec
I (46) boot: ESP-IDF v4.3-dev-1903-g83c3e79d8-dirty 2nd stage bootloader
I (46) boot: compile time 12:35:25
I (46) boot: chip revision: 0
I (47) boot.esp32s2: SPI Speed : 80MHz
I (51) boot.esp32s2: SPI Mode : DIO
I (54) boot.esp32s2: SPI Flash Size : 4MB
I (58) boot: Enabling RNG early entropy source...
I (63) boot: Partition Table:
I (65) boot: ## Label Usage Type ST Offset Length
I (71) boot: 0 nvs WiFi data 01 02 00009000 00004000
I (78) boot: 1 otadata OTA data 01 00 0000d000 00002000
I (84) boot: 2 phy_init RF data 01 01 0000f000 00001000
I (91) boot: 3 factory factory app 00 00 00010000 00100000
I (98) boot: 4 ota_0 OTA app 00 10 00110000 00100000
I (104) boot: 5 ota_1 OTA app 00 11 00210000 00100000
I (111) boot: 6 fs Unknown data 01 82 00310000 000f0000
I (117) boot: End of partition table
I (121) boot: Defaulting to factory image
I (124) esp_image: segment 0: paddr=0x00010020 vaddr=0x3f000020 size=0x24ddc (151004) map
I (164) esp_image: segment 1: paddr=0x00034e04 vaddr=0x3ffc6930 size=0x03b40 ( 15168) load
I (168) esp_image: segment 2: paddr=0x0003894c vaddr=0x40022000 size=0x00404 ( 1028) load
0x40022000: _WindowOverflow4 at I:/repos/esp-idf-fork/components/freertos/port/xtensa/xtensa_vectors.S:1730
I (169) esp_image: segment 3: paddr=0x00038d58 vaddr=0x40022404 size=0x072c0 ( 29376) load
0x40022404: _coredump_iram_start at ??:?
I (184) esp_image: segment 4: paddr=0x00040020 vaddr=0x40080020 size=0xab1a0 (700832) map
0x40080020: _stext at ??:?
I (331) esp_image: segment 5: paddr=0x000eb1c8 vaddr=0x400296c4 size=0x0d268 ( 53864) load
0x400296c4: rtc_sleep_pd at I:/repos/esp-idf-fork/components/esp_hw_support/port/esp32s2/rtc_sleep.c:50
I (346) esp_image: segment 6: paddr=0x000f8438 vaddr=0x40070000 size=0x0002c ( 44) load
0x40070000: _rtc_code_start at ??:?
I (346) esp_image: segment 7: paddr=0x000f846c vaddr=0x50000000 size=0x01810 ( 6160) load
I (365) boot: Loaded app from partition at offset 0x10000
I (365) boot: Disabling RNG early entropy source...
I (375) cache: Instruction cache : size 8KB, 4Ways, cache line size 32Byte
I (375) cpu_start: Pro cpu up.
I (429) cpu_start: Pro cpu start user code
I (429) cpu_start: cpu freq: 160000000
I (429) cpu_start: Application information:
I (429) cpu_start: Project name: remote-scale
I (433) cpu_start: App version: 0.0.4.104
I (437) cpu_start: Compile time: Jan 18 2021 12:35:20
I (442) cpu_start: ELF file SHA256: 98e8d8eb49897e92...
I (447) cpu_start: ESP-IDF: v4.3-dev-1903-g83c3e79d8-dirty
I (453) heap_init: Initializing. RAM available for dynamic allocation:
I (460) heap_init: At 3FF9E02C len 00001FD4 (7 KiB): RTCRAM
I (465) heap_init: At 3FFCE9A8 len 0002D658 (181 KiB): DRAM
I (470) heap_init: At 3FFFC000 len 00003A10 (14 KiB): DRAM
I (476) spi_flash: detected chip: generic
I (479) spi_flash: flash io: dio
I (486) cpu_start: Starting scheduler on PRO CPU.
I (487) Sleep: esp_reset_reason=1 Timespent in deep sleep=1106ms
I (487) Sleep: Not a deep sleep reset
I (487) Main: Wake reason=0
Thanks,
- Scott