Page 1 of 1

What's the proper way to enable FreeRTOS automatic light sleep?

Posted: Wed Sep 25, 2019 5:36 pm
by RMandR
I'm trying to enable automatic light sleep when all the tasks in my application are sleeping (vTaskDelay). I have placed the following code in main() and enabled power management and Tickless_idle in MENUCONFIG:

Code: Select all

esp_pm_config_esp32_t pm_config = {
				.max_freq_mhz = 240,
				.min_freq_mhz = 10,
				.light_sleep_enable = true
};
ESP_ERROR_CHECK(esp_pm_configure(&pm_config));
Even though I did see a small power reduction, it's still consuming about 50mA which tells me the cores are still running.

one of the tasks waits on xQueueReceive for GPIO input, and the other sleeps most of the time.

What am I doing wrong?

Thanks,

-a

Re: What's the proper way to enable FreeRTOS automatic light sleep?

Posted: Wed Sep 25, 2019 5:48 pm
by Ritesh
Hello,

Which ESP32 IDF you are using? Also can you please check using tasklist function like which task is running and which task is on waiting stage or something like that?

So that you will get an idea like how many tasks are really running to accommodate your requirement for sleep mode.

If possible then please post your complete application code for understanding purpose.