System Off (MCXE31B standby)

Browse source code on GitHub

Overview

This sample demonstrates the use of sys_poweroff() on the NXP FRDM-MCXE31B board.

Unlike SoCs that expose resumable suspend states, MCXE31B’s only low-power mode is standby, which is reset-on-wake: the run domain is powered down and a wake event triggers a functional reset. The application therefore models standby as system power-off rather than a Zephyr PM suspend state.

The sample arms an RTC alarm as the wake source, powers the SoC off, and the RTC alarm later wakes (reboots) the board. On the next boot the sample reports that it woke from standby and retrieves a cycle count from standby-retained noinit memory. The sample repeats the cycle CONFIG_APP_TEST_CYCLES times, which defaults to 10.

Requirements

The FRDM-MCXE31B board with a serial console connected.

Building and Running

west build -b frdm_mcxe31b samples/boards/nxp/frdm_mcxe31b/system_off
west flash

Sample Output

Cold boot
Powering off in 3 s...
Powering off in 2 s...
Powering off in 1 s...
Wake-up alarm set for 5 seconds (cycle 1/10)
Powering off

*** Booting Zephyr OS ***
Woke from standby
Retained standby cycle count: 1/10
Powering off in 3 s...
Powering off in 2 s...
Powering off in 1 s...
Wake-up alarm set for 5 seconds (cycle 2/10)
Powering off
...

*** Booting Zephyr OS ***
Woke from standby
Retained standby cycle count: 10/10
Completed 10 standby cycles

The board powers off, the RTC alarm wakes it after 5 seconds, and the boot banner reappears (a reset, not a resume). The standby-retained noinit counter lets the sample stop after the configured number of standby cycles.

See also

System power off
Counter