Turning off CPU1 during runtime

daviherc
Posts: 10
Joined: Wed Apr 28, 2021 5:31 pm

Turning off CPU1 during runtime

Postby daviherc » Thu Mar 23, 2023 12:47 pm

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?

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

Re: Turning off CPU1 during runtime

Postby ESP_Sprite » Fri Mar 24, 2023 2:40 am

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.

MicroController
Posts: 1726
Joined: Mon Oct 17, 2022 7:38 pm
Location: Europe, Germany

Re: Turning off CPU1 during runtime

Postby MicroController » Fri Mar 24, 2023 8:32 pm

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.

Who is online

Users browsing this forum: Bing [Bot] and 193 guests