Page 1 of 1

Turning off CPU1 during runtime

Posted: Thu Mar 23, 2023 12:47 pm
by daviherc
Hello,

it is not very frequently that my device needs both CPU cores to be running at the same time. In order to save energy, I would like to be able to turn the CPU1 on and off during my device runtime.

I checked the sleep modes documentation for esp-idf v5.0.1 but I did not find a solution to my particular situation (I checked https://docs.espressif.com/projects/esp ... modes.html).

Is this even possible? If yes, how can I do that?

Re: Turning off CPU1 during runtime

Posted: Fri Mar 24, 2023 2:40 am
by ESP_Sprite
I don't think the CPU1 core can be turned off farther than the WFI instruction that is automatically called by the FreeRTOS idle task already does. However, if power reduction is what you're looking for, I'd suggest turning on power management which will automatically make the ESP32 go into the lowest power mode that is applicable at any time.

Re: Turning off CPU1 during runtime

Posted: Fri Mar 24, 2023 8:32 pm
by MicroController
Intriguing idea :)
Seeing the DPORT_APPCPU_CLKGATE_EN and DPORT_APPCPU_RESETTING registers, I assume that hardware-wise it should be possible to completely stop the App core. The more tricky part would be to get it back up and running, which may or may not require a reset of the core, depending on if the core's internal state/registers survive its clock getting halted...
Unfortunately I don't think that FreeRTOS supports this - which means that things will immediately go bad as soon as FreeRTOS tries to interact with the core that's not running/reacting to messages.