Page 1 of 1

Reset in light sleep

Posted: Sat Apr 10, 2021 12:29 am
by peterglen
I have code that puts the ESP32 to light sleep with a timer (10s) and wakes it up. The code works as intended on the ESP32-WROOM32D, but it fails in ESP-WROOM32 (older, no D)

The failure appears to be that the (no D) chip does not go to sleep, and the RTC timer {WD} resets the system; [Confirmed it with an Amp Meter]

rst:0x10 (RTCWDT_RTC_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:1
load:0x3fff0030,len:4
load:0x3fff0034,len:4812
load:0x40078000,len:13840
load:0x40080400,len:3132
entry 0x40080600
I (272) cpu_start: Pro cpu up.
I (272) cpu_start: Starting app cpu, entry point is 0x40081058
0x40081058: call_start_cpu1 at /home/peterglen/esp/esp-idf.4.3/components/esp_system/port/cpu_start.c:124

I tried to disable the RTC timer, no change; but, when I extend the RTC timer's wachdog interval, it extends the reboot interval.

The sleep code does not contain anything special; just calling the API-s as normal.

gl_light_milli is set to 10
esp_err_t errw = esp_sleep_enable_timer_wakeup(gl_light_milli * 1000);
esp_light_sleep_start();
// wake code ... just a printf etc

This works well on the WROOM32D / DevKitC V4; does not work on the WROOM32 / DevKitC V2;

I am curious if there be an insight why this is happening, and solution to this. Thank you;

Peter Glen

Re: Reset in light sleep

Posted: Mon Apr 12, 2021 3:53 pm
by peterglen
More info:

IDF version:

ESP-IDF: v4.3-dev-1720-g494a124d9

I upgraded from a 3.x , same error on both IDF versions.

Re: Reset in light sleep

Posted: Sat May 01, 2021 7:07 am
by WiFive
Do you know if the older chip is rev0?

Re: Reset in light sleep

Posted: Wed Aug 25, 2021 6:41 am
by dtung2008
Same light sleep problem here with ESP-WROOM-32 module. Is it possible to identify the problem and even provide a workaround?

Re: Reset in light sleep

Posted: Sun Apr 16, 2023 4:03 pm
by stevew
Hi,

Did you find the solution? I am running into the same problem.

Thank you so much!

Best

Re: Reset in light sleep

Posted: Wed May 24, 2023 11:42 am
by dandybell
I'm getting the same problem. Code works fine with no sleep.
When I use Light Sleep, after a variable number of sleep/wake cycles, the WDT causes a reset.
Tried many many of the solutions and workarounds shown around the net but nothing seems to work.
I've just found this reply to another post:
https://github.com/espressif/esp-idf/issues/11315
which suggests adding:-
REG_SET_FIELD(RTC_CNTL_BIAS_CONF_REG, RTC_CNTL_DBG_ATTEN, 3);
There is no explanation what this is doing but I've put it in my setup code to see what happens.
As we speak I haven't had an RTCWDT reset yet after 15 mins which is a good sign, but not conclusive, and I am wary as to what this line of code may have also affected. I'll be conducting a bunch of tests to make sure the WDT still fires when it should as disabling it is not something I want to do!
Does anyone know what this code does?

Re: Reset in light sleep

Posted: Wed May 24, 2023 11:46 am
by dandybell
Re last post: I spoke too soon. It still reset but took 20 mins this time - a bit longer than usual but the problem is still there!

Re: Reset in light sleep

Posted: Thu May 25, 2023 3:44 pm
by stevew
Hi

I am disabling Ble and restarting BLE after sleep, but my problem is reinitialization takes time.

Re: Reset in light sleep

Posted: Mon May 29, 2023 4:02 pm
by dandybell
Does disabling BLE before light sleep stop the reset problem?

Re: Reset in light sleep

Posted: Tue Dec 05, 2023 11:50 pm
by expresspotato
Were you ever able to solve this issue?

Simply put BLE & Light Sleep has been broken since 4.4.x and still is here on 5.2.1.

Intermittet crashes with RTCWDT_RTC_RESET.

I've tried everything from "extra crystal current" to other boards, and everything in between. Something is just wrong and the CPU doesn't wake from sleep.

Anyone from Espressif?