Reset in light sleep

peterglen
Posts: 27
Joined: Thu Mar 22, 2018 5:55 pm

Reset in light sleep

Postby peterglen » Sat Apr 10, 2021 12:29 am

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

peterglen
Posts: 27
Joined: Thu Mar 22, 2018 5:55 pm

Re: Reset in light sleep

Postby peterglen » Mon Apr 12, 2021 3:53 pm

More info:

IDF version:

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

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

WiFive
Posts: 3529
Joined: Tue Dec 01, 2015 7:35 am

Re: Reset in light sleep

Postby WiFive » Sat May 01, 2021 7:07 am

Do you know if the older chip is rev0?

dtung2008
Posts: 1
Joined: Wed Aug 25, 2021 1:12 am

Re: Reset in light sleep

Postby dtung2008 » Wed Aug 25, 2021 6:41 am

Same light sleep problem here with ESP-WROOM-32 module. Is it possible to identify the problem and even provide a workaround?

stevew
Posts: 3
Joined: Sun Apr 16, 2023 3:59 pm

Re: Reset in light sleep

Postby stevew » Sun Apr 16, 2023 4:03 pm

Hi,

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

Thank you so much!

Best

dandybell
Posts: 3
Joined: Wed May 24, 2023 11:08 am

Re: Reset in light sleep

Postby dandybell » Wed May 24, 2023 11:42 am

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?

dandybell
Posts: 3
Joined: Wed May 24, 2023 11:08 am

Re: Reset in light sleep

Postby dandybell » Wed May 24, 2023 11:46 am

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!

stevew
Posts: 3
Joined: Sun Apr 16, 2023 3:59 pm

Re: Reset in light sleep

Postby stevew » Thu May 25, 2023 3:44 pm

Hi

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

dandybell
Posts: 3
Joined: Wed May 24, 2023 11:08 am

Re: Reset in light sleep

Postby dandybell » Mon May 29, 2023 4:02 pm

Does disabling BLE before light sleep stop the reset problem?

expresspotato
Posts: 24
Joined: Fri May 28, 2021 1:58 pm

Re: Reset in light sleep

Postby expresspotato » Tue Dec 05, 2023 11:50 pm

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?

Who is online

Users browsing this forum: No registered users and 73 guests