SPIM (EasyDMA) power consumption

Hi,

We are working on power optimization for our project using the nRF5340 board. Our code implements an RTOS, BLE for data transfer, I2C and SPI for device communication, and UART for data logging.

When we disabled UART and all peripherals, including DFU, and enabled only BLE, we achieved a current consumption in the 245 µA range, which we previously discussed in our post

So we tried enabling spim in our code which is used for communicating with NAND flash, we observed the current consumption increased to around 3 mA. We tried deinitializing SPIM and setting the SPIM state to suspend after each communication using these functions :

/*deinit spim*/
nrfx_spim_uninit(self->spim);
/*suspend spim peripheral*/
ret = pm_device_action_run(self->spi_dev, PM_DEVICE_ACTION_SUSPEND);

, but the current consumption remained around 3mA.

This is our overlay configuration.
&spi4_sleep {
    group1 {
        psels = <NRF_PSEL(SPIM_MOSI, 0, 13)>,
                <NRF_PSEL(SPIM_MISO, 0, 14)>,
                <NRF_PSEL(SPIM_SCK, 0, 17)>;
        low-power-enable;
    };
};

&spi4 {
    status = "okay";
    label = "SPI_4";
    compatible = "nordic,nrf-spim";
    pinctrl-0 = < &spi4_default >;
    pinctrl-1 = < &spi4_sleep>;
    pinctrl-names = "default", "sleep";
    cs-gpios = <&gpio0 18 GPIO_ACTIVE_LOW>; 
    max-frequency = <DT_FREQ_M(32)>;    
};

Is there any way we can reduce the power consumption of SPIM?

Parents
  • Hi,

    We enabled SPIM (EasyDMA) for NAND communication and disabled all other peripherals to measure the current consumed by the SPIM peripheral alone. Here are our observations:

    This is the code we used:
    spim_test_sample.zip

    As we observed that calling the PM function did not significantly reduce the current consumption. To clear our doubts, we tried the same with SPI code and made the following observations:

    This is the sample code:
    spi_test_sample.zip

    Using SPI, it seems the device enters suspend mode when calling the function.

    • We would like to know how we can achieve the same low current consumption when using SPIM instead of SPI.
    • Why is the device not going into suspend mode when using SPIM APIs?

       

Reply
  • Hi,

    We enabled SPIM (EasyDMA) for NAND communication and disabled all other peripherals to measure the current consumed by the SPIM peripheral alone. Here are our observations:

    This is the code we used:
    spim_test_sample.zip

    As we observed that calling the PM function did not significantly reduce the current consumption. To clear our doubts, we tried the same with SPI code and made the following observations:

    This is the sample code:
    spi_test_sample.zip

    Using SPI, it seems the device enters suspend mode when calling the function.

    • We would like to know how we can achieve the same low current consumption when using SPIM instead of SPI.
    • Why is the device not going into suspend mode when using SPIM APIs?

       

Children
No Data
Related