How to make zephyr power management unit work with NRF52?

My situation is similar to this post https://devzone.nordicsemi.com/f/nordic-q-a/97262/config_log-over-uart-and-power-management, where I am trying to turn off I2C, UART, and PWM during the entry of the idle thread and enable them back up when exiting. However, setting CONFIG_PM=y and CONFIG_PM_DEVICE=y doesn't seem to work, and the callback function registered using pm_notifier_register() doesn't get called. Is there perhaps an example available on how to properly configure low power mode for NRF52832 using Zephyr? I just want to ensure that all peripherals not in use will be turned off while the idle thread is running.

  • Hello,

    Most of the peripherals will enter idle mode automatically when not actively used so they will not impact the idle current anyway. Additionally, we have the Power management unit (PMU) which ensures that clock sources are released when they are no longer needed.

    However, UART is an exception as it needs to remain in an active mode for as long as it is enabled in order to be ready to receive data at any time. Therefore, it is up to the application to decide when it is safe/ok to power down the UART. I posted a code snippet demonstrating how this can be done from the app here:  RE: How to put the UART to sleep (low power mode)  

    idle thread and enable them back up when exiting

    The problem with this approach is that these peripherals will often perform the transfer with DMA while the program is running the idle thread. 

    Best regards,

    Vidar

Related