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

RMandR
Posts: 75
Joined: Mon Oct 29, 2018 3:13 pm

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

Postby RMandR » Wed Sep 25, 2019 5:36 pm

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

Ritesh
Posts: 1365
Joined: Tue Sep 06, 2016 9:37 am
Location: India
Contact:

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

Postby Ritesh » Wed Sep 25, 2019 5:48 pm

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.
Regards,
Ritesh Prajapati

Who is online

Users browsing this forum: djixon and 148 guests