Power management with nRF Connect SDK v2.6.1

Hello,

I want to make periodically wake up nRF52840, performing some work (connecting to MQTT broker, sending some data) and after that going to low power mode. Then the nRF52840 have to be waken up after some time expires [1 - 300] seconds or by an interrupt from an accelerometer.
I have read this can be achieved using `pm_state_force` function. However it seems that this is not the way since nRF Connect SDK v2.5.0. I also read this thread, where is said that pm_suspend_devices function shall be used.

Which is the header for that function, may it is zephyr/kernel/include/kernel_internal.h ?
Can you provide here some guidelines and/or examples of how to deal with such task in nRF Connect v2.6.1.

Regards,
Ivan

Parents Reply
  • Thank you for your answer.

    There is no specific reason to use the power management API. I just want to be sure that the device will consume less current when in idle state. If k_sleep does the work it is fine. From other hand, there is k_cpu_idle() function (I saw an example from chatGPT). Taking in regards your answer, it seems k_sleep is natural way. However, how these functions are related - k_sleep() and k_cpu_idle() ?

Children
Related