Using nrf_regulators_system_off in newer Connect SDKs

I am having difficulty getting the nrf_regulators_system_off function to work correctly on newer versions of the Connect SDK.

In earlier versions v1.3 and such, the call would power down the 9160 to a very low current draw. Now, when I use it, i see a power draw compatible to all threads idle.

I suspect this has something to do with the rearchitecting of the SPM configuration file and that I'm not successfully granting non-secure rights to the power regulators but I'm not sure. All the posts on this topic (that I've found) are relatively old and reference older SDK versions.

It would be quite helpful to have a simple modern, example that compiled for the latest SDKs (I'm on v1.6.1 but v1.7 is fine) that powered off the 9160 and restarted it with a button press.

Thanks.

Doug

Parents
  • Hi Doug,

     

    I am having difficulty getting the nrf_regulators_system_off function to work correctly on newer versions of the Connect SDK.

    In earlier versions v1.3 and such, the call would power down the 9160 to a very low current draw. Now, when I use it, i see a power draw compatible to all threads idle.

    I suspect this has something to do with the rearchitecting of the SPM configuration file and that I'm not successfully granting non-secure rights to the power regulators but I'm not sure. All the posts on this topic (that I've found) are relatively old and reference older SDK versions.

    It would be quite helpful to have a simple modern, example that compiled for the latest SDKs (I'm on v1.6.1 but v1.7 is fine) that powered off the 9160 and restarted it with a button press.

    This example shows the usage of systemoff using the pm library:

    https://github.com/nrfconnect/sdk-zephyr/blob/master/samples/boards/nrf/system_off/src/main.c#L93

     

    Which effectively calls nrf_regulators_system_off here:

    https://github.com/nrfconnect/sdk-zephyr/blob/v2.6.99-ncs1/soc/arm/nordic_nrf/nrf91/power.c#L19

     

    In earlier versions v1.3 and such, the call would power down the 9160 to a very low current draw. Now, when I use it, i see a power draw compatible to all threads idle.

    How much do you see now?

     

    Kind regards,

    Håkon

Reply
  • Hi Doug,

     

    I am having difficulty getting the nrf_regulators_system_off function to work correctly on newer versions of the Connect SDK.

    In earlier versions v1.3 and such, the call would power down the 9160 to a very low current draw. Now, when I use it, i see a power draw compatible to all threads idle.

    I suspect this has something to do with the rearchitecting of the SPM configuration file and that I'm not successfully granting non-secure rights to the power regulators but I'm not sure. All the posts on this topic (that I've found) are relatively old and reference older SDK versions.

    It would be quite helpful to have a simple modern, example that compiled for the latest SDKs (I'm on v1.6.1 but v1.7 is fine) that powered off the 9160 and restarted it with a button press.

    This example shows the usage of systemoff using the pm library:

    https://github.com/nrfconnect/sdk-zephyr/blob/master/samples/boards/nrf/system_off/src/main.c#L93

     

    Which effectively calls nrf_regulators_system_off here:

    https://github.com/nrfconnect/sdk-zephyr/blob/v2.6.99-ncs1/soc/arm/nordic_nrf/nrf91/power.c#L19

     

    In earlier versions v1.3 and such, the call would power down the 9160 to a very low current draw. Now, when I use it, i see a power draw compatible to all threads idle.

    How much do you see now?

     

    Kind regards,

    Håkon

Children
  • Thanks for the response. Perhaps I wasn't clear, the problem is controlling power from a non-secure app. The examples you reference seem to be compiled for secure mode. 

    As far as power differences, my board has some extra stuff on it so I can't give absolute numbers. However, the difference between what used to work and the current builds is around 240 uA.

    Doug

  • For another data point, I ported my app to a Thingy91. In the "power down mode" it's still drawing 170uA. I suspect that's far too high.

    Doug

  • Hi Doug,

     

    It is hard to say what happens here, because the external devices are affecting the sleep current. This means that you have to ensure that any GPIOs going to external devices must be set to "idle" state before entering systemoff mode.

    dboling said:
    Thanks for the response. Perhaps I wasn't clear, the problem is controlling power from a non-secure app.

    The NRF_REGULATORS register is by default set to non-secure:

    https://github.com/nrfconnect/sdk-nrf/blob/master/subsys/spm/Kconfig#L289

     

    I do not think this is the issue. If it were permissions problem, you will have seen a fault occurring.

     

    Kind regards,

    Håkon

  • OK, I'll continue to work on it. One point, the initial code you pointed me was for the nrf52, not the 91. Is there an equivalent sample for the 91? Thanks.

    Doug

  • One other point. Calling nrf_regulators_system_off results in exactly the same current as calling k_sleep with a Forever flag. Seems like I'm missing something.

    Doug