I am using following script to test VF61 standby suspend mode with SNVS RTC as wakeup source on Colibri Eva Board V3.2.
#!/bin/sh
n=0
while true;do
echo +3600 > /sys/class/rtc/rtc0/wakealarm
while [ $? -ne 0 ]
do
sleep 5
echo retry to write wakealarm
echo 0 > /sys/class/rtc/rtc0/wakealarm
echo +3600 > /sys/class/rtc/rtc0/wakealarm
done
#echo mem > /sys/power/state
echo "before suspend"
timedatectl
sleep 10
echo "enter into standy mode\n"
temp1="$(cat /sys/class/rtc/rtc0/wakealarm)"
temp2="$(cat /sys/class/rtc/rtc0/since_epoch)"
echo -e "wakealarm: $temp1\t since_epoch: $temp2\t\n"
echo standby > /sys/power/state
n=`expr $n + 1`
echo "################# Wake up $n ######################"
#date "+%Y-%m-%d %H:%M:%S"
echo "wake from suspend"
timedatectl
sleep 1
done
Only internal RTC is used.
root@colibri-vf:~# dmesg|grep rtc
[ 1.301121] rtc-ds1307: probe of 0-0068 failed with error -5
[ 1.315359] snvs_rtc 400a7000.snvs:snvs-rtc-lp: rtc core: registered 400a7000.snvs:snvs- as rtc0
[ 2.590597] snvs_rtc 400a7000.snvs:snvs-rtc-lp: setting system clock to 2018-02-01 14:26:04 UTC (1517495164)
NTP is also enabled. Suspend gap is 3600 seconds. Sometimes, it is not waken up by snvs-rtc. As the link textlog shows, 8th wakeup should be activated in one hour later(wakealarm is 1517556813). VF61 is waken up manually by GPIO after two and half hours later, since_epoch value already beyond 1517556813.