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

CONFIG_NRF71_IDLE_POWER_RAM_RETAIN_FULL (default)

No RAM power-down call is made. All application RAM stays retained.

CONFIG_NRF71_IDLE_POWER_RAM_RETAIN_UNUSED_ONLY

Calls power_down_unused_ram() at boot. The unused memory range is computed from the image layout, ensuring that the active image, stack, and buffer memory are never modified. This is the recommended tier for a Wi-Fi build.

CONFIG_NRF71_IDLE_POWER_RAM_RETAIN_64K

Calls power_down_ram() at boot to power down everything past the first 64 KiB of application RAM. Only safe if the whole image fits below that boundary.

CONFIG_NRF71_IDLE_POWER_RAM_RETAIN_128K

Calls power_down_ram() at boot to power down everything past the first 128 KiB of application RAM. Only safe if the whole image fits below that boundary.

CONFIG_NRF71_IDLE_POWER_RAM_RETAIN_256K

Calls power_down_ram() at boot to power down everything past the first 256 KiB of application RAM. Only safe if the whole image fits below that boundary.

CONFIG_NRF71_IDLE_POWER_RAM_RETAIN_512K

Calls power_down_ram() at boot to power down everything past the first 512 KiB of application RAM. Only safe if the whole image fits below that boundary.

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

Header file: include/nrf71_idle_power.h
Source files: lib/nrf71_idle_power/
nRF71 idle power helpers