How to know if the CPU is not working

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

How to know if the CPU is not working

Jump to solution
235 Views
hankwang
Contributor V

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?

Labels (1)
0 Kudos
Reply
1 Solution
199 Views
yipingwang
NXP TechSupport
NXP TechSupport

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.

View solution in original post

0 Kudos
Reply
2 Replies
231 Views
hankwang
Contributor V

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

0 Kudos
Reply
200 Views
yipingwang
NXP TechSupport
NXP TechSupport

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.

0 Kudos
Reply