nrf5340 spi power consumption

I am using the nrf5340 on a nrf7002fk dev kit. I am interested in low power operation so I am measuring the power consumed.

I am running a simple app:

int main(void)
{
while(1) { k_msleep(1000); }

return 0;
}

when I compile with this simple prj.conf file I measure 3uA current consumption

CONFIG_SERIAL=n
CONFIG_PM=y
CONFIG_PM_DEVICE=y

however when add "CONFIG_SPI=y" to the prj.conf file the current consumption jumps to 130 uA.

Is it possible to reduce this power consumption by suspending the SPI logic when it is not being used ?

Parents
  • Hello,

    Yes, this could be because the peripheral remains active. I recommend suspending the SPI device when it's not needed. See the Device Power Management section from the Academy.

    Kind Regards,

    Abhijith

  • Hi Menon

    Thankyou for your response.

    The academy link you provided uses driver level code. If possible, I would like to resolve the problem using my simple application level example before I move into drivers.

    I updated my code to create a pointer to the SPI device and then called pm_device_action_run() with PM_DEVICE_ACTION_SUSPEND. I expected this to suspend the SPI device. 

    I confirmed that the spim_suspend function was getting called inside the spi_nrfx_spim.c driver. However the current remained at 130 uA.

    I am not sure why the current is at 130 uA if the spi is suspended. Is there a step I am missing ?

    Here is the updated code and prj.conf files:

    static const struct device* const SpiDev = DEVICE_DT_GET(DT_NODELABEL(spi4));
    int main(void)
    {
    pm_device_action_run(SpiDev, PM_DEVICE_ACTION_SUSPEND);
    while(1) { k_msleep(1000); }

    return 0;
    }

    CONFIG_SERIAL=n
    CONFIG_SPI=y

    CONFIG_PM=y
    CONFIG_PM_DEVICE=y
    CONFIG_PM_DEVICE_RUNTIME=y

Reply
  • Hi Menon

    Thankyou for your response.

    The academy link you provided uses driver level code. If possible, I would like to resolve the problem using my simple application level example before I move into drivers.

    I updated my code to create a pointer to the SPI device and then called pm_device_action_run() with PM_DEVICE_ACTION_SUSPEND. I expected this to suspend the SPI device. 

    I confirmed that the spim_suspend function was getting called inside the spi_nrfx_spim.c driver. However the current remained at 130 uA.

    I am not sure why the current is at 130 uA if the spi is suspended. Is there a step I am missing ?

    Here is the updated code and prj.conf files:

    static const struct device* const SpiDev = DEVICE_DT_GET(DT_NODELABEL(spi4));
    int main(void)
    {
    pm_device_action_run(SpiDev, PM_DEVICE_ACTION_SUSPEND);
    while(1) { k_msleep(1000); }

    return 0;
    }

    CONFIG_SERIAL=n
    CONFIG_SPI=y

    CONFIG_PM=y
    CONFIG_PM_DEVICE=y
    CONFIG_PM_DEVICE_RUNTIME=y

Children
No Data
Related