This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Zephyr power management issues

Dear Nordic, 

As per power management, could you please suggest any thoughts for following:

We have two ICs on the board connected to nRF52840: 6-DOF sensor (over SPI) and flash mem (over QSPI). Both of them are powered from one external LDO regulator controlled by GPIO output, and there is a 'regulator' node has been defined for it. 

1. 'nordic,qspi-nor' device node model doesn't include 'vin-supply' parameter, how we could connect it to regulator to take automatic control over QSPI flash power?

2. When accessing 6-DOF sensor, we need to take manual control over it's powering, and - when it is not in work - it should be disabled completely, including SPI lines. For now, when we turn off the regulator manually, the SPI lines stays active and give parasitic supply to the sensor and increase overall consumption. What approach is preferred to implement here? Something like that? (https://github.com/zephyrproject-rtos/zephyr/blob/main/samples/subsys/pm/device_pm/src/main.c)

Parents
  • Thank you for the update. 

    1. The regulator subsystem here describes how you can add a regulator to any kind of external device (like sensors or external flash drives). It should be possible to implement something like this for both the QSPI flash and sensor you're using.

    2. Check out the subsystem linked to above as well as the regulator.h file in \NCS_VERSION\zephyr\include\drivers\

    Best regards,

    Simon

Reply
  • Thank you for the update. 

    1. The regulator subsystem here describes how you can add a regulator to any kind of external device (like sensors or external flash drives). It should be possible to implement something like this for both the QSPI flash and sensor you're using.

    2. Check out the subsystem linked to above as well as the regulator.h file in \NCS_VERSION\zephyr\include\drivers\

    Best regards,

    Simon

Children
  • Hi Simonr, 

    We applied the regulator susbystem as well by your recommendation (at another ticket). 

    The question is not about the regulator module itself (it works fine enough for the moment) still about the proper approach to implement that in the application.

    The dummy_driver application shows relatively clear approach about regulator PM chain management (parent - child suspending), and we're going to implement someting like that.

    The still active questions are:

    1. Basic 'nordic,qspi-nor' driver doesn't have 'vin-supply' field, should we implement our custom driver for NOR flash based on this driver? Or should we manually turn on-off the regulator for flash? Please note there will be logging and perhaps bootloader modules in chain with QSPI driver.

    2. Should we consider using PM_DEVICE_RUNTIME functionality and related functions for PM management of external ICs?

    3. As of SPI driver, there is an issue with PM function: although it has de-initialization for SCK/MOSI/MISO pins, the CS pin still remains active and leads parasitic supply of external ICs (spi_context_cs_configure() - the only function for CS pin configuration from spi_context.h). How we should deal that?

    PS. pls note the pm/device_runtime.h header has no closing '}' bracket for 'external "C" {' definition. It leads to error on using the module with C++ sources.

Related