disable core 1 for saving power?

cyberman54
Posts: 27
Joined: Sun Jan 14, 2018 7:47 pm

disable core 1 for saving power?

Postby cyberman54 » Sun Jan 14, 2018 7:49 pm

Is it possible to pin all tasks to core 0 and switch off core 1 to save power?

ESP_igrr
Posts: 2071
Joined: Tue Dec 01, 2015 8:37 am

Re: disable core 1 for saving power?

Postby ESP_igrr » Mon Jan 15, 2018 2:48 am

Yes, you can choose "Run FreeRTOS on first core only" option in menuconfig, Component config > FreeRTOS menu and build the application again. That will disable 2nd CPU and all the tasks will run on the 1st.

cyberman54
Posts: 27
Joined: Sun Jan 14, 2018 7:47 pm

Re: disable core 1 for saving power?

Postby cyberman54 » Mon Jan 15, 2018 9:05 pm

Thank you for your reply!
So it is possible, good to know.

But i am not using the ESP-IDF, i am using PlatformIO extension with MS Visual Studio Code. And i'm using framework Arduino for ESP32, because i need a library which has not been ported for ESP32.

Does anyone know where i can find / set the UNICORE compile option on PlatformIO IDE?

cyberman54
Posts: 27
Joined: Sun Jan 14, 2018 7:47 pm

Re: disable core 1 for saving power?

Postby cyberman54 » Wed Jan 17, 2018 7:18 am

I found out how to set the single core option from platformIO IDE, someone gave me the hint that this can be done with a build option:

Code: Select all

build_flags = -D  CONFIG_FREERTOS_UNICORE
I tried it and compiled my code with this build option. It has no impact on the power consumption, not 1 mA. So i think the CPU is still running both cores.

How can i check this?

WiFive
Posts: 3529
Joined: Tue Dec 01, 2015 7:35 am

Re: disable core 1 for saving power?

Postby WiFive » Wed Jan 17, 2018 8:45 am

Arduino and platformio are using precompiled libs so adding that compiler option won't do anything since libesp32.a is already compiled.

cyberman54
Posts: 27
Joined: Sun Jan 14, 2018 7:47 pm

Re: disable core 1 for saving power?

Postby cyberman54 » Wed Jan 17, 2018 12:42 pm

Thanks for this explanation, now i understand why my change has no impact.

Which Arduino libraries fpr ESP32 should i recompile with the UNICORE build-option to get a single core cpu?

dizcza
Posts: 56
Joined: Tue Sep 07, 2021 6:59 pm

Re: disable core 1 for saving power?

Postby dizcza » Mon Dec 05, 2022 9:29 pm

Is it possible to disable the second core at runtime?

I have a flag in a header file that, if set, uses ULP instead of the second core.

Code: Select all

#define ULP_ENABLE 1

#if ULP_ENABLE
// start ULP and disable core APP_CPU_NUM
#else
// use APP_CPU_NUM to perform the same task
#endif
I could perhaps issue a deep sleep on the second core (can I?) and never wake up if this flag is set, I'm not sure. Either way, deep sleep != power down, not even hibernation.

lbernstone
Posts: 826
Joined: Mon Jul 22, 2019 3:20 pm

Re: disable core 1 for saving power?

Postby lbernstone » Mon Dec 05, 2022 10:39 pm

The Tasmota group regularly releases framework sets for the solo chips on platformio.
https://github.com/tasmota/platform-espressif32

Who is online

Users browsing this forum: No registered users and 90 guests