2064553_en-US

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

2064553_en-US

2064553_en-US

How to know if the CPU is not working

Hey, I have a question. Because my device needs a power saving mechanism. After 10 minutes, the user needs to enter suspend mode when not using the device.

How do we know the user is not operating the device? Or do you know if the i.MX8M CPU has a register and can let us know?

i.MX 8M | i.MX 8M Mini | i.MX 8M NanoRe: How to know if the CPU is not working

1. user can use the command below to check if the system is in idle state.

root@imx8mpevk:~# top -bn1 | grep -iE "Tasks|load|%Cpu"
top - 07:40:26 up 15 min, 2 users, load average: 0.00, 0.02, 0.05
Tasks: 152 total, 1 running, 151 sleeping, 0 stopped, 0 zombie
%Cpu(s): 0.0 us, 2.2 sy, 0.0 ni, 97.8 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st

when the "% idle" consistently is above 90% (here the example is 97.8 id), it means the system is in idle state.

2. User can test it with the examples below.
- run command "echo mem > /sys/power/state" or "echo freeze > /sys/power/state". (press SW1 button to wakeup it on imx8mpevk)
- run command "rtcwake -u -s 120 -m mem" to put the system into suspend to save power and then automatically wake up it after the specified time 120 seconds.

Re: How to know if the CPU is not working

Sorry, I forgot to say that. The operating system is yocto.

Tags (1)
No ratings
Version history
Last update:
‎11-21-2025 09:50 PM
Updated by: