Low power management of external flash

Hi,

my setup is the following:

- SDK 2.6.3

- nRF5340

- Low power management for external flash enabled

- Logging enabled (based on littleFS)

- external flash used to store continuously data 

With this configuration i am observing an exponential increase of booting time due to the introduction of the the entry to and exit from low power of the external flash as defined in the file \v2.6.3\zephyr\drivers\flash\spi_nor.c.

The characteristic of my external flash for entry and exit the deep sleep mode are the following:

- 30us to enter in Deep Power down mode

- 10us to exit Deep Power down mode

Those values are rounded up to 1 ms each by the defines in \v2.6.3\zephyr\drivers\flash\spi_nor.c 

#define T_RES1_MS DIV_ROUND_UP(DT_INST_PROP(0, t_exit_dpd), NSEC_PER_MSEC)

#define T_DP_MS DIV_ROUND_UP(DT_INST_PROP(0, t_enter_dpd), NSEC_PER_MSEC)

1. Why the need to convert in milliseconds those delays (in the specific case, causing an increase between 30 and 100 times) ?

2. For such kind of microseconds delay would not be better to use even a blocking delay like NRFX_DELAY_US ? (I have modified the spi.nor file and seems to work properly)

3. Is there a way - even i looked for but could not find it - to enable the power management for the external flash at runtime ? So in my case, it would be disabled at the boot up and once done, it gets enabled.

4. Eventually, could this change be considered in the future version of sdk ?

Thanks in advance for your support.

Kind regards

Riccardo Gaiati

 

  • Hi,

    1. Why the need to convert in milliseconds those delays (in the specific case, causing an increase between 30 and 100 times) ?

    In the API we're using we're rounding up to nearest ms. If your device are capable of running with those delays and your activity can handle it (and you can handle the extra current consumption that might come with this), you're free to test out using 30 and 10 µs instead.

    2. For such kind of microseconds delay would not be better to use even a blocking delay like NRFX_DELAY_US ? (I have modified the spi.nor file and seems to work properly)

    If it works and you've tested it properly, then you should be able to use the nrfx_delay_us instead, but note that we've only tested with what is present in the SDK by default

    3. Is there a way - even i looked for but could not find it - to enable the power management for the external flash at runtime ? So in my case, it would be disabled at the boot up and once done, it gets enabled.

    PM device API: https://docs.nordicsemi.com/bundle/ncs-latest/page/zephyr/services/pm/index.html 

    4. Eventually, could this change be considered in the future version of sdk ?

    I'm not 100% sure this is relevant after you've seen through the PM device in item 3, but let me know if that change sanything

    Kind regards,
    Andreas

  • Hi,

    thanks for the reply.

    Regarding the PM APIs, i can control the entry ti and exit from low power of the flash through those functions. But what about the log system ? Would it call these function aswell ? 

Related