Can I turn off one cpu core of ESP32 with Arduino IDE?

Hi,
I have a NodeMCU ESP32 board and I'm thinking of ways to reduce power consumption.
Can I turn off one cpu core of ESP32 with Arduino IDE?
Also, can I disable the UART without having to cut a wire or something?

I have google ways to reduce power consumption ad most of them include sleep modes, and it doesn't work for my particular application. Any other suggestions are welcome.

Yes and no.

If you are not using freeRTOS, all the WiFi code will be ran on core0 and all the code you write will be ran off of core 1. freeRTOS can be used to put all the code on one core. Though putting all the code onto one core will not result in the other core being shut off, the other core will have nothing to do, decreasing your power use, slowing up your process, and decreasing RAM availability.

Why are you unable to use a sleep more?

The ESP32 has a 3rd core, the ULP core which is the Ultra Low Power Core. The ULP core can be ran at anytime, even during deep sleep modes, as away to monitor the various GPIO pins.

The ULP can be used in the Arduino IDE. The ULP Coprocessor (Legacy GNU Make). https://docs.espressif.com/projects/esp-idf/en/latest/api-guides/ulp-legacy.html. If you have used MASM before then programming the ULP core is ‘simple.’

In the Arduino IDE, you will get 2048 32 bit address of program space for the ULP tasking. You should write down each instruction and its memory address, on paper, so you can keep track of any variable placements.

Re UARTS

static void IRAM_ATTR flush_uarts(void)
{
    for (int i = 0; i < 3; ++i) {
        uart_tx_wait_idle(i);
    }
}

static void IRAM_ATTR suspend_uarts(void)
{
    for (int i = 0; i < 3; ++i) {
        REG_SET_BIT(UART_FLOW_CONF_REG(i), UART_FORCE_XOFF);
        while (REG_GET_FIELD(UART_STATUS_REG(i), UART_ST_UTX_OUT) != 0) {
            ;
        }
    }
}

static void IRAM_ATTR resume_uarts(void)
{
    for (int i = 0; i < 3; ++i) {
        REG_CLR_BIT(UART_FLOW_CONF_REG(i), UART_FORCE_XOFF);
        REG_SET_BIT(UART_FLOW_CONF_REG(i), UART_FORCE_XON);
        REG_CLR_BIT(UART_FLOW_CONF_REG(i), UART_FORCE_XON);
    }
}

https://github.com/espressif/esp-idf/blob/master/components/esp32/sleep_modes.c

Idahowalker:
Re UARTS

Thanks! Can you please explain what this actually does? I'm a beginner with this stuff. Can I call the IRAM_ATTR suspend_uarts function in the loop function to disable UART?