QSPI Flash power consumption

Hi,

We are using nRF53 and interfacing MX66 flash over QSPI in our project. We are having some issues with the overall power consumption.

After making some investigation, I found out that disabling CONFIG_NORDIC_QSPI_NOR drops the average current from ~4mA to few hundred microAmps. This took my attention and led me to questioning the QSPI power consumption.

Hence, I started making some measurements on the nRF53-DK board to see the power impact of the QSPI block. For the tests I used:

  • nRF Connect SDK v2.2.0
  • SPI_Flash example under ncs\v2.2.0\zephyr\samples\drivers\spi_flash
  • nRF53-DK as the target board and Power Profiler Kit 2 in source meter mode as the profiler.

I have made 4 different measurements. As mentioned in the documentation below, SB18 needs to be shorted for the power consumption of the external memory to be added to the measured current.

https://infocenter.nordicsemi.com/index.jsp?topic=%2Fug_nrf5340_dk%2FUG%2Fdk%2Fhw_external_memory.html

In the first set of measurement, I kept SB18 open to see power consumption without the external flash.

  1. 1st measurement: SB18 kept open. No changes made at prj.conf for power optimisations. Measured average current is 6.12mA at 3V

 

  1. 2nd measurement: SB18 kept open and prj.conf changed as below to minimise power consumption. Measured average current is 340uA at 3V

CONFIG_SERIAL=n
CONFIG_LOG=n
CONFIG_DEBUG=n
CONFIG_CONSOLE=n

#CONFIG_STDOUT_CONSOLE=y
CONFIG_FLASH=y
CONFIG_SPI=y

 

  1. 3rd measurement: SB18 shorted (flash power consumption included). No power optimisation in prj.conf (prj.conf as below). Measured average current is 10.81mA at 3V

CONFIG_STDOUT_CONSOLE=y
CONFIG_FLASH=y
CONFIG_SPI=y

  1. 4th measurement: SB18 shorted (flash power consumption included). Power optimisation in prj.conf as below. Measured current is 10.31mA at 3V

CONFIG_SERIAL=n
CONFIG_LOG=n
CONFIG_DEBUG=n
CONFIG_CONSOLE=n

#CONFIG_STDOUT_CONSOLE=y
CONFIG_FLASH=y
CONFIG_SPI=y

As a summary:

When SB18 is kept open (flash consumption excluded) and with power optimised config, power consumption is 340uA.

When SB18 is shorted (flash consumption included) and with the same config as above, power consumption is 10.31mA.

SPI_Flash sample project does not continuously read/write to the flash as I can see from the source code. Hence after the erase-write-read test sequence is over, there shouldn’t be any flash access.

 

My questions are:

  • What is the reason for this high power consumption when interfacing the flash over QSPI?
  • How can I tackle this problem to reduce the power consumption?
  • Is there any way to initially disable the QSPI block at the prj.conf and then enable it on the fly when flash access is required, and then disable it again?

Regards,

Kerem

Parents
  • Hi,

    4th measurement: SB18 shorted (flash power consumption included). Power optimisation in prj.conf as below. Measured current is 10.31mA at 3V

    If you short SB18 and SB16 is already shorted then you risk powering the whole DK from VDD_NRF, thus increasing the current consumption.

    It's expected that external flash will consume a lot of current when it's active. Most flash support a low power mode and it's activated by writing to it via the QSPI peripheral. Are you doing this in your application?

    regards

    Jared 

  • Hi Jared,

    Thanks for your reply.

    I think the deep power mode is activated by the parameters given in the peripheral configuration through overlay files.
    We are using "has-dpd" parameter and enter/exit timing parameters.

    By the way, I updated our custom firmware to use SPI to communicate to MX66 flash (rather than QSPI) and power consumption reduced significantly.

    The two configurations for QSPI and SPI usage are below:

    &qspi {
        status = "okay";
        sck-pin = <17>;
        io-pins = <13>, <14>, <15>, <16>;
        csn-pins = <18>;
        // mx66l1g: mx66l1g45g@0 {
        mx25r64: mx25r6435f@0 {
            compatible = "nordic,qspi-nor";
            reg = <0>;
            // MX66L1G supports only pp and pp4io
            writeoc = "pp4io";
            // MX66L1G supports all readoc options
            readoc = "read4io";
            sck-frequency = <8000000>;
            label = "MX66L1G";
            jedec-id = [c2 20 1b];
            sfdp-bfp = [
                e5 20 fb ff  ff ff ff f3  44 eb 08 6b  08 3b 04 bb
                fe ff ff ff  ff ff 00 ff  ff ff 44 eb  0c 20 0f 52
                10 d8 00 ff  23 72 f5 00  82 ed 04 cc  44 83 68 44
                30 b0 30 b0  f7 c4 d5 5c  00 be 29 ff  f0 d0 ff ff
            ];
            size = <1073741824>;
            has-dpd;
            t-enter-dpd = <10000>;
            t-exit-dpd = <35000>;
        };
    };
    &spi3 {
        status = "okay";
        sck-pin = <17>;
        mosi-pin = <13>;
        miso-pin = <14>;
        cs-gpios = <&gpio0 18 GPIO_ACTIVE_LOW>;

            mx66l1g: mx66l1g45g@0 {
            compatible = "jedec,spi-nor";
            reg = <0>;
            spi-max-frequency = <8000000>;
            label = "MX66L1G";
            jedec-id = [c2 20 1b];
            sfdp-bfp = [
                e5 20 fb ff  ff ff ff f3  44 eb 08 6b  08 3b 04 bb
                fe ff ff ff  ff ff 00 ff  ff ff 44 eb  0c 20 0f 52
                10 d8 00 ff  23 72 f5 00  82 ed 04 cc  44 83 68 44
                30 b0 30 b0  f7 c4 d5 5c  00 be 29 ff  f0 d0 ff ff
            ];
            size = <1073741824>;
            has-dpd;
            t-enter-dpd = <10000>;
            t-exit-dpd = <35000>;
        };
    };

    Is there anything else I need to do to get the flash into DPD mode when not used?

    Also regarding my last question in my last message, is there a way to enable/disable a peripheral on the fly with nRF Connect SDK?

Reply
  • Hi Jared,

    Thanks for your reply.

    I think the deep power mode is activated by the parameters given in the peripheral configuration through overlay files.
    We are using "has-dpd" parameter and enter/exit timing parameters.

    By the way, I updated our custom firmware to use SPI to communicate to MX66 flash (rather than QSPI) and power consumption reduced significantly.

    The two configurations for QSPI and SPI usage are below:

    &qspi {
        status = "okay";
        sck-pin = <17>;
        io-pins = <13>, <14>, <15>, <16>;
        csn-pins = <18>;
        // mx66l1g: mx66l1g45g@0 {
        mx25r64: mx25r6435f@0 {
            compatible = "nordic,qspi-nor";
            reg = <0>;
            // MX66L1G supports only pp and pp4io
            writeoc = "pp4io";
            // MX66L1G supports all readoc options
            readoc = "read4io";
            sck-frequency = <8000000>;
            label = "MX66L1G";
            jedec-id = [c2 20 1b];
            sfdp-bfp = [
                e5 20 fb ff  ff ff ff f3  44 eb 08 6b  08 3b 04 bb
                fe ff ff ff  ff ff 00 ff  ff ff 44 eb  0c 20 0f 52
                10 d8 00 ff  23 72 f5 00  82 ed 04 cc  44 83 68 44
                30 b0 30 b0  f7 c4 d5 5c  00 be 29 ff  f0 d0 ff ff
            ];
            size = <1073741824>;
            has-dpd;
            t-enter-dpd = <10000>;
            t-exit-dpd = <35000>;
        };
    };
    &spi3 {
        status = "okay";
        sck-pin = <17>;
        mosi-pin = <13>;
        miso-pin = <14>;
        cs-gpios = <&gpio0 18 GPIO_ACTIVE_LOW>;

            mx66l1g: mx66l1g45g@0 {
            compatible = "jedec,spi-nor";
            reg = <0>;
            spi-max-frequency = <8000000>;
            label = "MX66L1G";
            jedec-id = [c2 20 1b];
            sfdp-bfp = [
                e5 20 fb ff  ff ff ff f3  44 eb 08 6b  08 3b 04 bb
                fe ff ff ff  ff ff 00 ff  ff ff 44 eb  0c 20 0f 52
                10 d8 00 ff  23 72 f5 00  82 ed 04 cc  44 83 68 44
                30 b0 30 b0  f7 c4 d5 5c  00 be 29 ff  f0 d0 ff ff
            ];
            size = <1073741824>;
            has-dpd;
            t-enter-dpd = <10000>;
            t-exit-dpd = <35000>;
        };
    };

    Is there anything else I need to do to get the flash into DPD mode when not used?

    Also regarding my last question in my last message, is there a way to enable/disable a peripheral on the fly with nRF Connect SDK?

Children
  • Hi,

    That should be correct,

    kerko said:
    Also regarding my last question in my last message, is there a way to enable/disable a peripheral on the fly with nRF Connect SDK?

    You can try to use the power management api and set the QSPI device into a low power state as explained here. Call pm_device_state_set() with PM_DEVICE_STATE_SUSPENDED when done using the peripheral and PM_DEVICE_STATE_ACTIVE before you start using it.

    regards
    Jared

Related