The power management library is used for handling idle mode and entering System OFF or DFU modes.
Key features include:
- CPU usage tracer
- Standby timeout
- Shutdown retry mechanism
- Schedule handling library support
- FPU support
CPU usage tracer
Enable NRF_PWR_MGMT_CONFIG_DEBUG_PIN_ENABLED to trace the CPU usage using pin NRF_PWR_MGMT_SLEEP_DEBUG_PIN . The pin is set when CPU enters sleep state.
Enable NRF_PWR_MGMT_CONFIG_CPU_USAGE_MONITOR_ENABLED and NRF_PWR_MGMT_CONFIG_LOG_LEVEL to use the logger module for tracing CPU usage (0% - 100%). CPU usage is computed and logged every second.
NRF_PWR_MGMT:DEBUG:CPU Usage: 25% NRF_PWR_MGMT:DEBUG:CPU Usage: 40% NRF_PWR_MGMT:DEBUG:CPU Usage: 36% NRF_PWR_MGMT:DEBUG:CPU Usage: 30%
- Warning
- When CPU usage tracing is enabled, this module sets SEVONPEND in System Control Block (SCB). This operation is needed, because in this configuration __WFE() is called from a critical region. Setting this flag can be done safely with the SoftDevice only from interrupt priority not higher than SVC.
Standby timeout
Using NRF_PWR_MGMT_CONFIG_STANDBY_TIMEOUT_ENABLED from enabled module will generate a NRF_PWR_MGMT_SHUTDOWN_GOTO_SYSOFF event after NRF_PWR_MGMT_CONFIG_STANDBY_TIMEOUT_S seconds of inactivity ( nrf_pwr_mgmt_feed resets the inactivity timer).
Shutdown retry mechanism
Shutdown or Enter DFU modes can be blocked by one or more modules. To restore this process, call nrf_pwr_mgmt_shutdown with NRF_PWR_MGMT_SHUTDOWN_CONTINUE . Alternatively, you can enable NRF_PWR_MGMT_CONFIG_AUTO_SHUTDOWN_RETRY . In this configuration, the module will try to retry this process every second.
Schedule handling library support
To enable Schedule handling library support in this module, set NRF_PWR_MGMT_CONFIG_USE_SCHEDULER .
FPU support
With NRF_PWR_MGMT_CONFIG_FPU_SUPPORT_ENABLED set, this module will clear FPU events before entering sleep mode.