Page 1 of 1

Automatic Light Sleep

Posted: Wed Sep 16, 2020 2:49 pm
by tlechman
Hi!

There seems to be very limited information about attaining automatic light sleep even though it looks like that was part of the IDF v3.3 release. I'd like to achieve the typical RTOS scenario of disabling the clock and leaving memory in retention while in the FreeRTOS idle task. From the datasheet, it seems like espressif refers to this state as light sleep.

So far, I've enabled tickless idle and enabled power management and dynamic frequency scaling via menuconfig and have seen the current drop to ~15mA @ 3.3V while idling in the idle task. This seems to be in line with modem sleep but very high for light sleep.

My program is the system/console example running inside its own task. Entering light sleep with the console command drops consumption down to 4mA.

I'm running ESP IDF v4.1 via platformio on the ESP32 DevKitC and debugging with the ESP-Prog. All current measurements were taken between the esp-prog supply and the 3.3v pin on the dev kit.

Re: Automatic Light Sleep

Posted: Wed Sep 16, 2020 11:31 pm
by boarchuz
Setting those options via menuconfig ensures the functionality is included in the build, but you then need to enable it at runtime via esp_pm_configure() with esp_pm_config_esp32_t::light_sleep_enable = true.

https://docs.espressif.com/projects/esp ... ement.html

Re: Automatic Light Sleep

Posted: Thu Sep 17, 2020 1:49 pm
by tlechman
Is there a way to prevent light sleep from disconnecting the debugger?