SPI slave power consumption

Hello

According to the following ticket  SPI slave mode power usage  SPI-slave interface should not increase power consumption in idle mode. I did some testing and as soon as I set CONFIG_SPI_SLAVE=y the current consumption increases by around 250 uA even though cs-pin is not selected. If cs-pin is selected the power consumption rises further above 1mA.

Is there something I can do in order to prevent increased idle power consumption?

The prj.conf and the relevant dts-overlay are as follows

The prj.conf and the relevant dts-overlay are as following

CONFIG_NCS_SAMPLES_DEFAULTS=y

CONFIG_LOG=y
CONFIG_LOG_MODE_DEFERRED=y
CONFIG_USE_SEGGER_RTT=y

CONFIG_PM=y
CONFIG_PM_DEVICE=y
CONFIG_PM_DEVICE_RUNTIME=y

CONFIG_GPIO=y
CONFIG_SERIAL=n
CONFIG_SPI=y
CONFIG_SPI_SLAVE=y
CONFIG_I2C=n

&pinctrl {
    spi3_default: spi3_default {
            group1 {
                psels = <NRF_PSEL(SPIS_SCK, 1, 13)>,
                        <NRF_PSEL(SPIS_MISO, 1, 12)>,
                        <NRF_PSEL(SPIS_MOSI, 1, 11)>,
                        <NRF_PSEL(SPIS_CSN, 1, 14)>;
            };
    };
    spi3_sleep: spi3_sleep {
            group1 {
                psels = <NRF_PSEL(SPIS_SCK, 1, 13)>,
                        <NRF_PSEL(SPIS_MISO, 1, 12)>,
                        <NRF_PSEL(SPIS_MOSI, 1, 11)>,
                        <NRF_PSEL(SPIS_CSN, 1, 14)>;
                    low-power-enable;
            };
    };
};

&spi3 {
    compatible = "nordic,nrf-spis";
    status = "okay";
    def-char = < 0 >;
    pinctrl-0 = <&spi3_default>;
    pinctrl-1 = <&spi3_sleep>;
    pinctrl-names = "default", "sleep";
};

Thank you!

Best regards

Sandro

Parents Reply
  • Hi,

    The Blog device power management api suggests using 'pm_device_state_set()'  to suspend a device. This function has been removed in Zephyr 3.1.0, now 'pm_device_runtime_put()' and 'pm_device_runtime_get()' should be used as far as I know (only after enabling with 'pm_device_runtime_enable()'). But when I call 'pm_device_runtime_enable()' for a device with device-tree entry 'compatible="nordic,nrf-spis"' it will return -ENOTSUP since no power-management callback is implemented/registered in the file "ncs\v2.4.0\zephyr\drivers\spi\spi_nrfx_spis.c"

    Therefore the question is whether this feature will be added or if there is another way of suspending the device?

    Best regards

    Sandro

Children
Related