power_mode_switch_rtos_imx95#
Overview#
The Power mode switch demo application demonstrates the use of power modes in the KSDK. The demo prints the power mode menu through the debug console, where the user can set the MCU to a specific power mode. The user can also set the wakeup source by following the debug console prompts. The purpose of this demo is to show how to switch between different power modes, and how to configure a wakeup source and wakeup the MCU from low power modes.
Tips: This demo is to show how the various power mode can switch to each other. However, in actual low power use case, to save energy and reduce the consumption even more, many things can be done including:
Disable the clock for unnecessary module during low power mode. That means, programmer can disable the clocks before entering the low power mode and re-enable them after exiting the low power mode when necessary.
Disable the function for unnecessary part of a module when other part would keep working in low power mode. At the most time, more powerful function means more power consumption. For example, disable the digital function for the unnecessary pin mux, and so on.
Set the proper pin state (direction and logic level) according to the actual application hardware. Otherwise, the pin current would be activated unexpectedly waste some energy.
Other low power consideration based on the actual application hardware.
Debug pins(e.g SWD_DIO) would consume addtional power, had better to disable related pins or disconnect them.
Supported Boards#
IMX95LPD5EVK-19
Hardware requirements
USB Type-C cable
IMX95LPD5-EVK board
J-Link Debug Probe
12V~20V power supply
Personal Computer
Headphone
Board settings
No special settings are required.
Prepare the Demo
Connect 12V~20V power supply and J-Link Debug Probe to the board, switch SW301 to power on the board.
Connect a USB Type-C cable between the host PC and the J1401 USB port on the target board.
Open a serial terminal with the following settings:
115200 baud rate
8 data bits
No parity
One stop bit
No flow control
Download the program to the target board (Please refer “Getting Started with MCUXpresso SDK for IMX95LPD5-EVK.pdf” for how to run different targets).
Launch the debugger in your IDE to begin running the example.
Running the demo
How to enter system suspend mode(such as M7 use sm as wakeup source): In linux console use command “echo mem > /sys/power/state” to suspend A55, then select SUSPEND mode in Mcore debug console and input “S” into select SM as wakeup source, input “idle” command in M33 console. The STBY LED on board will light. How to escape system suspend mode(such as M7 use sm as wakeup source): press enter in SM console, then input “wake” command to wakeup M7 and A55. Or press ONOFF button in board. NOTE: 1. M7 support LPTMR/LPUART/SM interface(wakeup command in sm consle or ONOFF button in board) wakeup source. 2. Option ‘P’ will suspend A55 core. 3. Please ensure the A55 already in SUSPEND mode, then press “W” button in Mcore debug console. A55 core will be wakeup.
The log below shows the output of the power mode switch demo in the terminal window:
Start SRTM communication
Task 1 is working now
#################### Power Mode Switch Task ####################
Build Time: Apr 25 2024--11:25:33
Core Clock: 800000000Hz
Select the desired operation
Press A to enter: Normal RUN mode
Press B to enter: WAIT mode
Press C to enter: STOP mode
Press D to enter: SUSPEND mode
Press P to suspend A55 core
Press W to wakeup A55 core
Waiting for power mode select..
Handle Peer Core Linkup
FRDM-IMX95
Hardware requirements
USB Type-C cable
FRDM-IMX95 board
J-Link Debug Probe
12V~20V power supply
Personal Computer
Headphone
Board settings
No special settings are required.
Prepare the Demo
Connect 12V~20V power supply and J-Link Debug Probe to the board, switch SW301 to power on the board.
Connect a USB Type-C cable between the host PC and the J1401 USB port on the target board.
Open a serial terminal with the following settings:
115200 baud rate
8 data bits
No parity
One stop bit
No flow control
Download the program to the target board (Please refer “Getting Started with MCUXpresso SDK for FRDM-IMX95.pdf” for how to run different targets).
Launch the debugger in your IDE to begin running the example.
Running the demo
How to enter system suspend mode(such as M7 use sm as wakeup source): In linux console use command “echo mem > /sys/power/state” to suspend A55, then select SUSPEND mode in Mcore debug console and input “S” into select SM as wakeup source, input “idle” command in M33 console. The STBY LED on board will light. How to escape system suspend mode(such as M7 use sm as wakeup source): press enter in SM console, then input “wake” command to wakeup M7 and A55. Or press ONOFF button in board. NOTE: 1. M7 support LPTMR/LPUART/SM interface(wakeup command in sm consle or ONOFF button in board) wakeup source. 2. Option ‘P’ will suspend A55 core. 3. Please ensure the A55 already in SUSPEND mode, then press “W” button in Mcore debug console. A55 core will be wakeup.
The log below shows the output of the power mode switch demo in the terminal window:
Start SRTM communication
Task 1 is working now
#################### Power Mode Switch Task ####################
Build Time: Apr 25 2024--11:25:33
Core Clock: 800000000Hz
Select the desired operation
Press A to enter: Normal RUN mode
Press B to enter: WAIT mode
Press C to enter: STOP mode
Press D to enter: SUSPEND mode
Press P to suspend A55 core
Press W to wakeup A55 core
Waiting for power mode select..
Handle Peer Core Linkup