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?
Solved! Go to Solution.
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.
Sorry, I forgot to say that. The operating system is yocto.
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.