Cellular: System off
This sample demonstrates how to use the System OFF functionality on the nRF92 Series.
Requirements
The sample supports the following development kit:
Hardware platforms |
PCA |
Board name |
|
|---|---|---|---|
nRF9251 DK |
nrf9251dk |
|
Overview
You can use this sample as an example of System OFF functionality on the nRF92 Series devices and for basic power measurement.
The sample supports wakeup from System OFF by GPIO and GRTC. You can also enable state retention in the System OFF mode. When state retention is enabled, the sample retains the following:
The number of boots
The number of times the system was put in System OFF mode
The total uptime since the initial power-on
The sample also verifies retained data integrity on wakeup.
Configuration
See Configuring and building for information about how to permanently or temporarily change the configuration.
Configuration options
Check and configure the following Kconfig options:
- CONFIG_SAMPLE_STATE_RETENTION
(bool) State retention in system off
Enable state retention in system off using retained memory driver.
- CONFIG_SAMPLE_GPIO_WAKEUP
(bool) Wake up from system off using a button
Enable wakeup from system off by pressing Button 0.
- CONFIG_SAMPLE_GRTC_WAKEUP
(bool) Wake up from system off using GRTC
Enable wakeup from system off using General Real-Time Counter (GRTC).
Building and running
This sample can be found under samples/cellular/system_off in the nRF Connect SDK folder structure.
To build the sample, follow the instructions in Building an application for your preferred building environment. See also Programming an application for programming steps and Testing and optimization for general information about testing and debugging in the nRF Connect SDK.
Note
When building repository applications in the SDK repositories, building with sysbuild is enabled by default.
If you work with out-of-tree freestanding applications, you need to manually pass the --sysbuild parameter to every build command or configure west to always use it.
Testing
After programming the sample to your development kit, complete the following steps to test it:
Connect the kit to the computer using a USB cable. The kit is assigned a serial port. Serial ports are referred to as COM ports on Windows, /dev/ttyACM devices on Linux, and /dev/tty devices on macOS. To list Nordic Semiconductor devices connected to your computer together with their serial ports, open a terminal and run the
nrfutil device listcommand. Alternatively, check your operating system’s device manager or its equivalent.Connect to the kit with a terminal emulator (for example, the Serial Terminal app). See Testing and optimization for the required settings and steps.
Press Button 0 on the development kit to wake up the system.
Sample output
*** Booting nRF Connect SDK v3.4.99-8132e53938bb ***
*** Using Zephyr OS v4.4.99-cc917d7a40ae ***
System off sample
Wakeup from System OFF by GPIO
State retention disabled
Entering System OFF; press Button 0 to restart
Dependencies
This sample uses the following sdk-nrfxlib library:
It uses the following Zephyr library: