sleep mode + FreeRtos task

Die_32_
Posts: 58
Joined: Wed May 05, 2021 2:42 pm

sleep mode + FreeRtos task

Postby Die_32_ » Thu Jan 20, 2022 12:56 pm

Is it possible to put the ESP32 in sleep mode while keeping a FreeRTOS with HIGHEST priority task active?

ESP_Sprite
Posts: 8921
Joined: Thu Nov 26, 2015 4:08 am

Re: sleep mode + FreeRtos task

Postby ESP_Sprite » Fri Jan 21, 2022 2:19 am

Sleep mode is generally intended as a way to shut the CPU down... so no, not really, you can't have a CPU that is shutdown and also running a task; the CPU needs to wake up to do something.

Can you tell us a bit more on what you're trying to do? Perhaps we can help you better with some more info.

Die_32_
Posts: 58
Joined: Wed May 05, 2021 2:42 pm

Re: sleep mode + FreeRtos task

Postby Die_32_ » Fri Jan 21, 2022 7:01 am

I have an ESp32 connected to a battery, doing stuff with WiFi MQTT and so on..

I would like to put in sleep mode in order to save battery, but I have connected to the ESP32 EN PIN a HW Watchdog, which is feeded by a FreeRtos task with HIGHEST priority.

I need to feed it with a square wave, and the reset time of the WDT is 1sec.

So I would like to put the ESP32 in sleep mode, but I need also that the task for the WDT won't stop.

Hope is clear enough

ESP_Sprite
Posts: 8921
Joined: Thu Nov 26, 2015 4:08 am

Re: sleep mode + FreeRtos task

Postby ESP_Sprite » Sat Jan 22, 2022 4:45 am

What particular sleep mode do you mean? If light sleep, you can probably have the CPU wake up on a timer and flip the square wave bit. If deep sleep, you'd need to use the ULP to generate the square wave.

Who is online

Users browsing this forum: Google [Bot] and 122 guests