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

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
&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 {
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Thank you!

Best regards

Sandro

  • I am using nrf-connect SDK 2.4.0

  • Hi,

    If you initialize the SPIS slave then it will use about 145 µA, you can decrease this current by using device power management api and set the state of the device to low power,

    regards

    Jared

  • Hello Jared,

    Thank you very much for your answer and sorry for my late response. My problem is, that the device needs to keep running with a BLE-application (and some other events), therefore I will not force the device to sleep-mode. Sadly the "nordic,nrf-spis" driver cant be suspended. Will this featrue be added or is there another driver I could use to suspend the SPI? Or is there a "how-to" to implement it myselfe?

    Best regards,

    Sandro

  • Hi,

    By "device" I mean the SPI peripheral, you should be able to uninit the peripheral by using the device power management api and setting the device to PM_DEVICE_STATE_SUSPENDED. 

    Note I've seen a bug report where the pins aren't set to their default state after initializing the device, so you might need to call gpio_pin_configure() and set them back to default, meaning Input, with No pull and input buffer disconnected to get the lowest power consumption,

    If I misunderstood you, please elaborate! 

    regards

    Jared 

  • 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

1 2