I am trying to use the lp1 mode on the Apalis TK1. To enter in the lp1 mode I use this command:
echo mem > /sys/power/state
According to this tutorial I need to set up a wakealarm in order to wake up after some time. The first problem I have is that my rtc1 does not have a wakealarm function. So I have tried with rtc0 and rtc2 with baffling results.
echo +20 > /sys/class/rtc/rtc0/wakealarm
This command wakes up the TK1, but if I set more time (60s for example) to the wakeup it sleeps forever. The same happens if I use the rtc2.
The rtc time is keept with a coin cell. If I set the time using hwclock commnad I noticed that rtc0 and rtc2 lose the time every shutdown. On the other hand rtc1 keeps the time perfectly. The firts boot I set the time using this command:
However I can not keep rtc0 and rtc2 using that commands.
To sum up, I managed to set and keep rtc1 time succesfully, but not rtc0 and rtc2, and I can not wake up the TK1 if the sleep time is longer that 20-30s.
I don’t care about rtc0 and rtc2 time losing, rtc1 is enough, but I need to wake up the TK1 after long time periods (7200s).
If useful this is my dmesg | grep -i rtc output:
dmesg | grep -i rtc
[ 0.530089] +V1.05_RTC: 1000 mV at 150 mA
[ 5.180799] as3722-rtc as3722-rtc.1: rtc core: registered as3722 as rtc0
[ 5.189387] as3722-rtc as3722-rtc.1: RTC interrupt 449
[ 5.199361] rtc-ds1307 0-0068: rtc core: registered m41t0 as rtc1
[ 5.207802] tegra_rtc tegra_rtc: rtc core: registered tegra_rtc as rtc2
[ 5.221345] tegra_rtc tegra_rtc: Tegra internal Real Time Clock
[ 6.663221] as3722-rtc as3722-rtc.1: setting system clock to 2000-01-01 00:00:24 UTC (946684824)
I have installed Nvidia JetPack instead of Nvidia Linux for Tegra (LT4). That way wake up function works perfectly. I don’t know which is the difference between Nvidia JetPack and Nvidia Linux for Tegra (LT4) that both are available to install from Easy Installer.
This is very interesting, I have been dabbling with this too. Looking at /sys/class/rtc/, I see rtc0and rtc1. I am using a custom carrier board (with no RTC onboard). Looking at dmesg, rtc0 is using the as3722 driver and rtc1 is using the tegra-rtc driver.
Any idea what the two devices are? From the datasheet, it seems there is only one RTC on the SBC.
For TK1, there is one RTC in the PMIC and another in the SoC. All of our Apalis carrier boards have another RTC on them. That gives you the 3 RTCs you see.
From the Apalis TK1 datasheet, it seems that the RTC on the PMIC (I’m guessing that’s /sys/class/rtc/rtc0) is connected to the main power rail to the modules. So am I right to assume that will it will remain on during lp1?
Does Nvidia Jetpack support LP0? If I run echo mem > /sys/power/state I get this output:
Warning: enabling a non-LP0 wake source 171
After resuming from sleep or after disconnecting the power supply of the TK1 only 1 RTC out of 3 keeps the time as you can see: (I have set all RTC to current date before the test.)