IntroductionLow-power IoT solutions enable devices to operate remotely for extended periods without direct power supply. Recently, the market demand for low-power Linux IoT devices is expected to continue growing, and the i.MX 91 is well-suited for this market segment. The NXP i.MX 91 processor is an application processor based on the Arm Cortex-A55 core, designed for low-power IoT and edge computing applications, featuring excellent energy management, built-in power modes, and efficient processing. According to NXP’s official documentation “AN14506-i.MX 91 Power Consumption Measurement”, the i.MX 91 offers various low-power modes. This article will detail how to configure and use various low-power modes, including Run Mode, Idle Mode, Suspend Mode, BBSM Mode, and Off Mode, through simple Linux commands on the FRDM-IMX91 development board running a Linux system.More information about the hardware and software of the FRDM-IMX91 can be downloaded from the following link on the NXP website:
http://nxp.com/FRDM-IMX91
1 Overview of i.MX91 Low Power ModesThe i.MX91 provides several low-power modes, with the following being the main modes:
The i.MX 91 supports the following power modes:• Run Mode: In this mode, all external power rails are active, the Cortex-A55 is active and running; other internal modules can be turned on/off based on application needs.• Idle Mode: This is the mode that the Cortex-A55 core automatically enters when no threads are running and all high-speed devices are inactive. The Cortex-A55 can enter power-gated state, and the DRAM and bus clocks are reduced. Most internal logic is clock-gated but still powered. Compared to Run Mode, all power rails for power management remain unchanged. Most modules maintain the same state as in Run Mode, so the interrupt response time in this mode is very short.• Suspend Mode: This mode is defined as the most energy-efficient mode. In this mode, all clocks and unnecessary power are turned off, and all power-gated parts of the SoC are power-gated. At the same time, the Cortex-A55 CPU is completely power-gated. Additionally, all internal digital logic and power-gated analog circuits are turned off, and all PHYs are power-gated. The VDD_SOC (and related digital power) voltage is reduced to the “suspend mode” voltage. Compared to Idle Mode, the exit time from this mode is longer, but the power consumption is also lower.• BBSM Mode: This mode is also known as RTC mode. In this mode, only the power of the BBSM domain remains on to keep the RTC and BBSM logic active.• Off Mode: In this mode, all power rails are turned off.2 Run ModeRun Mode is the default operating mode of the i.MX91, where all functional modules are active.Features
- All clocks and power domains are active
- CPU and all peripherals operate normally
- Maximum performance, but also maximum power consumption
Document AN14506, https://www.nxp.com/docs/en/application-note/AN14506.pdf, section “6 Reducing power consumption” introduces some methods and ideas for optimizing power consumption, which customers can further optimize based on actual usage needs.3 Idle ModeIdle Mode is a light low-power mode where the CPU enters a low-power state when there are no tasks, but peripherals continue to operate.Features
- CPU core enters low-power state
- Peripherals continue to operate normally
- Any interrupt can wake up the CPU
- Wake-up time is very short (<1ms)
3.1 Entering Idle Mode ProcessThe Idle Mode of the i.MX91 is implemented through the ARM Cortex-A55 WFI/WFE instructions, corresponding to Idle. In the Linux system, this is automatically managed by the CPU Idle subsystem. The Linux system automatically enters this mode when idle, without manual triggering.Of course, users can also execute the following command to manually trigger the system to enter Idle mode. Any input on the serial port can return from Idle state.
root@imx91frdm:~# cat /sys/power/statefreeze memroot@imx91frdm:~# echo freeze > /sys/power/state
3.2 Different Driver Voltage Mode SettingsUnlike the i.MX8M, the i.MX93 / i.MX91 does not have a separate VDD_ARM power rail set for the Cortex-A platform. All digital logic in the SoC uses a single VDD_SOC power rail. VDD_SOC can be nominal voltage (ND – Nominal Drive), overdrive voltage (OD – Over Drive), low drive voltage (LD – Low Drive), or suspend voltage (Suspend). Customers can statically choose to operate at nominal voltage, overdrive voltage, or low drive voltage. Therefore, it is important to note that DVFS (Dynamic Voltage Frequency Scaling) is not supported on the i.MX93 / i.MX91.The NXP i.MX Linux BSP documentation “IMX_REFERENCE_MANUAL”, sections “2.5.3 CPU Frequency Scaling (CPUFREQ)” and “2.5.4 Dynamic Bus Frequency” introduce the following commands that are not applicable on the i.MX93 / i.MX91.
# The maximum frequency can be checked using this command:cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq# Use the following command to view available governors:cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors# Set high-performance modeecho performance > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor# To enable the bus frequency driver, use the following commandecho 1 > /sys/bus/platform/drivers/imx_busfreq/soc:busfreq/enable# To disable the bus frequency driver, use the following command:echo 0 > /sys/bus/platform/drivers/imx_busfreq/soc:busfreq/enable
On the i.MX93 and i.MX91 platforms, customers can use the following commands to set different driver voltage modes. Specific commands can refer to NXP’s i.MX Linux BSP documentation “IMX_REFERENCE_MANUAL”, section “2.5.4 Dynamic Bus Frequency”.Note: The i.MX93 processor supports OD mode, while the i.MX91 processor does not support OD mode. LD mode settings are only supported when using the ld.dtb device tree.
echo 1 > /sys/devices/platform/imx93-lpm/mode // change to nd mode, ddr to half speedecho 0 > /sys/devices/platform/imx93-lpm/mode // back to od mode, ddr to full speedecho 2 > /sys/devices/platform/imx93-lpm/mode // change to ld mode, ddr to half speedecho 3 > /sys/devices/platform/imx93-lpm/mode // change to ld mode, ddr to lowest speed with SWFFC
Some setting logs are as follows:
root@imx91frdm:~# cat /sys/devices/platform/imx93-lpm/modeSystem is in ND mode with DDR 2400 MTS!root@imx91frdm:~# mhz1395 MHz, 0.7168 nanosec clockroot@imx91frdm:~# echo 2 > /sys/devices/platform/imx93-lpm//moderoot@imx91frdm:~# cat /sys/devices/platform/imx93-lpm/modeSystem is in LD mode with DDR 1200 MTS!root@imx91frdm:~# mhz895 MHz, 1.1173 nanosec clockroot@imx91frdm:~# echo 3 > /sys/devices/platform/imx93-lpm//moderoot@imx91frdm:~# cat /sys/devices/platform/imx93-lpm/modeSystem is in LD mode with DDR 625 MTS!root@imx91frdm:~# mhz894 MHz, 1.1186 nanosec clockroot@imx91frdm:~# echo 256 > /sys/devices/platform/imx93-lpm/auto_clk_gating
4 Suspend ModeThe Suspend Mode of the i.MX91 is a deep sleep mode where most of the system is turned off, but the RAM content is retained.Features
- CPU completely stopped
- Most peripherals turned off
- RAM content retained
- Only limited wake-up sources available (e.g., RTC, UART, GPIO, etc.)
- Medium wake-up time (5-10ms)
4.1 Entering Suspend Mode ProcessThe Suspend Mode of the i.MX91 is implemented through suspend-to-RAM:
4.2 RTC Alarm Wake-upThe RTC alarm wake-up command is as follows:
# Configure RTC alarm wake-up (after 30 seconds)echo 0 > /sys/class/rtc/rtc0/wakealarm # Clear existing alarmecho +30 > /sys/class/rtc/rtc0/wakealarm# Enter suspend modeecho mem > /sys/power/state# Or use systemctl command to enter suspend modesystemctl suspend
4.3 Debug UART Wake-upThe debug UART wake-up command is as follows:
# Configure debug UART wake-upecho enabled > /sys/class/tty/ttyLP0/power/wakeup # Enable, the corresponding disable command is:echo disabled > /sys/class/tty/ttyLP0/power/wakeup# If you do not know the current debug serial port number, you can execute "cat /proc/cmdline" to check, or execute the following command to configureecho enabled > /sys/class/tty/$(tty | cut -d'/' -f 3)/power/wakeup# Enter suspend modeecho mem > /sys/power/state# In suspend state, any input on the debug serial port will trigger wake-up
4.4 GPIO Wake-upIn the Linux system, add a device tree node similar to the following. Compile and use the new device tree file to boot the system.
/ { gpio-keys { compatible = "gpio-keys"; // Tell the kernel to use the gpio-keys driver to handle this device pinctrl-names = "default"; pinctrl-0 = <&pinctrl_gpio_keys>; // Link pin function multiplexing configuration power { label = "GPIO Key Power"; // Display a human-readable identifier in debugging and logs linux,code = <KEY_POWER>; // Generates power key event when pressed, the system will recognize this key as the power button gpios = <&gpio2 7 GPIO_ACTIVE_LOW>; // GPIO pin number (GPIO2_IO07) wakeup-source; // Mark this GPIO as a system wake-up source debounce-interval = <20>; // Set key debounce time, in milliseconds. Wait 20ms to confirm the state after the key state changes interrupt-parent = <&gpio2>; // The interrupt for this key is handled by the GPIO2 controller interrupts = <7 IRQ_TYPE_LEVEL_LOW>; // Interrupt number (corresponding to the 7th pin of GPIO2), low level triggers interrupt }; };};
&iomuxc { pinctrl_gpio_keys: gpio_keys_grp { fsl,pins = < MX93_PAD_GPIO_IO07__GPIO2_IO07 0x31e >; // Configure the physical pin GPIO_IO07 as GPIO2_IO07 function, enable pull-up resistor };};
Execute a command similar to the following to enter suspend mode.
# Enter suspend modeecho mem > /sys/power/state
Short-circuit the GPIO_IO07 pin to wake up the system.
4.5 Micro SD Card Insertion/Removal Wake-upStarting from version BSP L6.6.3_1.0.0, comment out “fsl,cd-gpio-wakeup-disable” in the device tree node to support SD card insertion/removal wake-up.4.6 USB Device Insertion/Removal Wake-upThe USB device insertion/removal wake-up command is as follows:
echo enabled > /sys/bus/platform/devices/4c100000.usb/power/wakeupecho enabled > /sys/bus/platform/devices/4c200000.usb/power/wakeupecho enabled > /sys/bus/platform/devices/ci_hdrc.0/power/wakeupecho enabled > /sys/bus/platform/devices/ci_hdrc.1/power/wakeupecho enabled > /sys/bus/usb/devices/usb1/power/wakeup# Enter suspend modeecho mem > /sys/power/state# In suspend state, inserting/removing USB devices from Type-A port will trigger wake-up
4.7 ONOFF Button Wake-upThe ONOFF button wake-up command is as follows:
# Enter suspend modeecho mem > /sys/power/state# In suspend state, short-press the ONOFF button to trigger wake-up
4.8 Ethernet Wake-upWake-on-LAN (WoL) is a network standard that allows remote wake-up of devices in sleep mode via network packets. A Magic Packet is a special Ethernet frame used to wake up devices that support Wake-on-LAN:
Implementation Steps:a) First, the user needs to modify the device tree to enable the Ethernet wake-up function, taking the ENET_QOS Ethernet port (corresponding to eth1 in Linux) as an example. We first need to add the node “fsl,magic-packet;” in the imx91-11×11-frdm.dts file located in the arch/arm64/boot/dts/freescale/ path.
b) Enable Wake on LAN
# Execute the following command to enable Wake-on-LAN.root@imx91frdm:~# ethtool -s eth1 wol g# Check statusroot@imx91frdm:~# cat /sys/class/net/eth1/device/power/wakeupenabledroot@imx91frdm:~# cat /sys/class/net/eth1/device/power/controlauto# Enter suspend moderoot@imx91frdm:~# echo mem > /sys/power/state
c) Send WOL magic packet to wake upInstall the “Wake On LAN” tool on a Windows or Linux host, configure the MAC address of the device to be awakened, and send the WOL magic packet. The following command is an example for a Linux host:
# Install wakeonlan toolsudo apt-get install wakeonlan # Ubuntu/Debiansudo yum install wakeonlan # CentOS/RHEL# Specify network interface to sendwakeonlan -i eth0 $TARGET_MAC
5 BBSM Mode (Battery-Backed Security Module)BBSM is one of the deep low-power modes of the i.MX91, where almost all systems are turned off, retaining only the BBNSM (Battery-Backed Non-Secure Module).Features
- Almost all systems are powered off
- Only the BBNSM module is retained
- Extremely low power consumption (<1mW)
- Longer wake-up time (100-200ms)
- System fully resets after waking up
5.1 Entering BBSM Mode Process
5.2 RTC Wake-upThe command to enter BBSM mode and RTC wake-up is as follows:
# Method 1: Use rtcwake command to shut down and set wake-up (after 30 seconds)rtcwake -m off -s 30
# Method 2: Configure RTC alarm wake-up (after 30 seconds)echo +30 > /sys/class/rtc/rtc0/wakealarm# Completely shut down the systempoweroff# Or use shutdown commandshutdown -h now
5.3 ONOFF Button Wake-upBy using the ONOFF button, a brief grounding in OFF mode will switch the internal power management state machine to ON state, triggering the power on. In ON mode, a brief grounding will generate an interrupt (for software-controlled shutdown), while grounding for about 5 seconds or longer will force a shutdown.6 Off ModeFeatures
- System completely powered off
- No state retained (including RAM content)
- Minimum power consumption (<0.1mW)
- Longest wake-up time (>1 second)
- Requires a complete system restart after waking up
6.1 Entering Off Mode ProcessFor the IMX91-FRDM board, Off Mode can only be achieved by unplugging the USB TYPE-C power cable. For the IMX91-EVK, in addition to unplugging the power, Off Mode can also be achieved through the SW301 switch.The main difference between Off Mode and BBSM Mode is that Off Mode does not retain any state information, requiring a complete system restart after waking up, while BBSM Mode retains some state information in the BBNSM.7 Power Consumption Comparison AnalysisThe table below lists approximate power consumption data for various modes. For specific power consumption test data in various operating scenarios, please refer to NXP’s official document “AN14506-i.MX 91 Power Consumption Measurement”,https://www.nxp.com/docs/en/application-note/AN14506.pdf.
|
Mode |
Typical Power Consumption |
Wake-up Time |
State Retention |
Applicable Scenarios |
|
Run Mode |
225mW |
N/A |
All |
Scenarios requiring full-speed operation |
|
Idle Mode |
154mW |
<1ms |
All |
Short idle periods requiring quick response |
|
Suspend Mode |
8mW |
5-10ms |
RAMContent |
Medium idle periods requiring context retention |
|
BBSMMode |
0.1mW |
100-200ms |
OnlyBBNSM |
Long idle periods, battery-powered scenarios |
|
Off Mode |
0mW |
>1s |
None |
Extremely low power scenarios with prolonged inactivity |
ConclusionThrough this tutorial, you have learned how to configure and use various low-power modes on the FRDM-IMX91 development board. According to NXP AN14506 documentation, the i.MX91 offers multiple low-power modes to meet the needs of different application scenarios. From simply turning off unused peripherals to Suspend Mode, deep BBSM Mode, and Off Mode, the i.MX91 provides a comprehensive low-power solution that can significantly extend battery life while maintaining system responsiveness and functionality. If you have any questions or suggestions regarding the article, feel free to leave a message or contact us directly.