nRF71 idle power
The nRF71 idle power library provides reusable helpers that reduce the System ON idle current of an application running on the nRF71 Series application core.
Overview
The library applies a Kconfig-selected RAM retention level at boot from a SYS_INIT() hook, so an application does not need any code changes to benefit from it.
It also enables the device power management Kconfig options that allow peripherals, such as the console UART, to suspend themselves while the system is idle.
RAM retention
The CONFIG_NRF71_IDLE_POWER_RAM_RETAIN choice selects how much application RAM stays powered during System ON idle, using the RAM power-down library:
Kconfig option |
Behavior |
|---|---|
|
No RAM power-down call is made. All application RAM stays retained. |
Calls |
|
Calls |
|
Calls |
|
Calls |
|
Calls |
Powering down RAM that the running image still uses corrupts live data, so the fixed-size tiers only make sense for a trivial image that fits below the selected boundary.
For a Wi-Fi build, use CONFIG_NRF71_IDLE_POWER_RAM_RETAIN_UNUSED_ONLY instead.
Console suspend and resume
Enabling CONFIG_PM_DEVICE_RUNTIME alone does not suspend a polling-mode UART console backend because such a backend never calls pm_device_runtime_put() on its own.
As a result, the UART and any clock it requests remain fully active for as long as the application is running, including when it is otherwise idle.
Call the nrf71_idle_power_suspend_console() function immediately before an idle k_sleep() or k_sem_take() call to suspend the device backing the zephyr,console chosen node.
Call the nrf71_idle_power_resume_console() function before the next print operation.
Both calls are no-ops if there is no zephyr,console chosen node, or if the console device is not ready, so a sample can call them unconditionally.
Diagnostics
Enable the CONFIG_NRF71_IDLE_DIAGNOSTICS Kconfig option to get the nrf71_idle_power_print_snapshot() function, which dumps the POWER, MEMCONF, GRTC, LFXO, and Wi-Fi core LRC0 registers so that they can be correlated with a power analyzer trace.
When the option is disabled, the function is still available as a no-op inline, so an application can call it unconditionally.
The option also configures a GPIO idle-phase marker from the idle-phase devicetree alias, when the application provides one.
When the CONFIG_SHELL Kconfig option is enabled, it also registers an idle_snapshot shell command for on-demand snapshots.
API documentation
include/nrf71_idle_power.hlib/nrf71_idle_power/