ESP32-WROOM-32E Resets when going to light sleep while using 32kHz crystal

juanfam1
Posts: 3
Joined: Fri Mar 26, 2021 4:59 pm

ESP32-WROOM-32E Resets when going to light sleep while using 32kHz crystal

Postby juanfam1 » Tue May 11, 2021 8:11 pm

Hello,
I'm using my own board with a ESP32-WROOM-32E with a 32.768kHz crystal.
Crystal: CM315D32768HZFT
Cap (both): 20pF
Res: 8MR

I followed design guidelines https://www.espressif.com/sites/default ... nes_en.pdf . Page 7.

I'm using ESP32 Power management "esp_pm_lock_acquire" "esp_pm_lock_release" to go into light sleep mode.

If I go into menuconfig and select RTC clock source as Internal 150kHz RC oscillator, the code works fine, it goes in and out of light sleep mode no problem.

If I go into menuconfig and select RTC clock source as External 32kHz crystal, and I disable the "light_sleep_enable" of the "esp_pm_config_esp32_t" then the code works fine but won't go into sleep mode.

If I go into menuconfig and select RTC clock source as External 32kHz crystal, and I enable the "light_sleep_enable" of the "esp_pm_config_esp32_t" then as soon as the code uses "esp_pm_lock_release" and goes to light sleep mode, it resets.

I need to use the crystal.
I need to be able to go to light sleep mode
I need to go to light sleep mode using power management instead of using "esp_sleep_enable_timer_wakeup" + "esp_light_sleep_start" because I need the WiFi to use the power management locks at it's own will.

Thank you and any help you can offer will be much appreciated.

Here is a copy of the reset error:
Guru Meditation Error: Core 0 panic'ed (IllegalInstruction). Exception was unhandled.
Memory dump at 0x40089fb4: 1a265205 6643454a db3fa11a
0x40089fb4: vTaskSwitchContext at C:/Users/juan/Desktop/esp-idf/components/freertos/tasks.c:2758

Core 0 register dump:
PC : 0x40089fba PS : 0x00060c33 A0 : 0x4008932f A1 : 0x3ffbbf90
0x40089fba: vTaskSwitchContext at C:/Users/juan/Desktop/esp-idf/components/freertos/tasks.c:2758

0x4008932f: _frxt_dispatch at C:/Users/juan/Desktop/esp-idf/components/freertos/xtensa/portasm.S:432

A2 : 0x00000000 A3 : 0x00050c23 A4 : 0x026d008b A5 : 0x026c5343
A6 : 0x3ffbc154 A7 : 0x00000000 A8 : 0x80089f7a A9 : 0x3ffbbf70
A10 : 0x3ffb3608 A11 : 0x00000000 A12 : 0x80089076 A13 : 0x3ffb0790
A14 : 0x3ffb0dd4 A15 : 0x00000001 SAR : 0x0000001d EXCCAUSE: 0x00000000
EXCVADDR: 0x00000000 LBEG : 0x00000000 LEND : 0x00000000 LCOUNT : 0x00000000

Backtrace:0x40089fb7:0x3ffbbf90 0x4008932c:0x3ffbbfb0 0x400892e2:0x400d5864 |<-CORRUPTED
0x40089fb7: vTaskSwitchContext at C:/Users/juan/Desktop/esp-idf/components/freertos/tasks.c:2758

0x4008932c: _frxt_dispatch at C:/Users/juan/Desktop/esp-idf/components/freertos/xtensa/portasm.S:431

0x400892e2: _frxt_int_exit at C:/Users/juan/Desktop/esp-idf/components/freertos/xtensa/portasm.S:231

0x400d5864: esp_pm_impl_waiti at C:/Users/juan/Desktop/esp-idf/components/esp32/pm_esp32.c:480

juanfam1
Posts: 3
Joined: Fri Mar 26, 2021 4:59 pm

Re: ESP32-WROOM-32E Resets when going to light sleep while using 32kHz crystal

Postby juanfam1 » Thu May 13, 2021 3:37 pm

Update:
So far making CONFIG_FREERTOS_IDLE_TIME_BEFORE_SLEEP=30 instead of 3 has made the problem go away. I'm still testing to confirm. It was an educated guess based on a BLE forum I read (I'm not using BLE) and luckily is working but I would still like for someone to point me in the right direction to look for any document that talks about this.

Who is online

Users browsing this forum: Majestic-12 [Bot] and 247 guests