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
  • Hello,

    You can try to abort the transaction and then apply the PM action to put the device in low power.

    For example, *p_instance is a pointer to the SPIM peripheral instance

    nrfx_spim_t const *p_instance;
    
    //Abort the ongoing transfer
    
    nrfx_spim_abort(p_instance)

    Then can try this as you have already in your code:

    ret = pm_device_action_run(self->spi_dev, PM_DEVICE_ACTION_SUSPEND);

    Is this CONFIG_PM_DEVICE=y enabled in config file?

    Thanks.

    BR

    Kazi

Reply
  • Hello,

    You can try to abort the transaction and then apply the PM action to put the device in low power.

    For example, *p_instance is a pointer to the SPIM peripheral instance

    nrfx_spim_t const *p_instance;
    
    //Abort the ongoing transfer
    
    nrfx_spim_abort(p_instance)

    Then can try this as you have already in your code:

    ret = pm_device_action_run(self->spi_dev, PM_DEVICE_ACTION_SUSPEND);

    Is this CONFIG_PM_DEVICE=y enabled in config file?

    Thanks.

    BR

    Kazi

Children
No Data
Related