Does the rtc on rockpi4 support wakealarms

It’s nice to have a RTC on the Rockpi4, but it does not seem to support wakealarms.

It is possible to set the alarm with

date -d "tomorrow 08:00" '+%s' > /sys/class/rtc/rtc0/wakealarm

but this does not seem to have any effect. Is this a hardware limitation (i.e. is the IRQ-line of the rtc-chip connected) or something missing in the driver?

The hardware should have the ability to power on with alarm. Check the schematic and the datasheet of pmic rk808, there are three condition to trigger the boot:

  • EN singal from low to high
  • EN is high and RTC alarm IRQ triggered
  • EN is high and PWRON button is pressed

@Stephen could you look at it?


I have tested the RTC wakealarms, and I find it works.


Use system image, rockpi4b-ubuntu-bionic-minimal-20190104_2101-gpt.img

Install and update these packages from left to right: rockchip-fstab, rockchip-overlay, u-boot, kernel, rockpi4-dtbo.

And install mate desktop (you can install other desktop)

sudo apt-get install ubuntu-mate-core  
sudo apt-get install ubuntu-mate-desktop


To test rtc wakealarm, execute commands at the terminal

$ date -d "today 20:26" '+%s' | sudo tee  /sys/class/rtc/rtc0/wakealarm

Click ‘suspend’. Or $ echo mem | sudo tee /sys/power/state

After the above operation, the red system led and desktop is off.

When it is 20:26, the system runs again. Red led is flashing and desktop is on.



thanks for this info. I didn’t even know that suspend works, I will try this with my setup (Armbian headless). Nevertheless, have you tested the wakealarm with a real shutdown (halt -p) as well? Suspend is fine, but requires constant power supply. In contrast, after shutdown the RTC backup battery should keep the alarm-time in the registers of the RTC.

Another question: I read the datasheet of the pmic. Is it correct that the registers of the RTC are accessible using I2C?

Best, Bernhard

Somehow, the shutdown wake alarm is not working yet.

Yes, the RTC registers are all accessible via I2C, you can just dump it. Go ahead and debugging :smiley:

I remember seeing option to turn on RockPi without replugging power after shutdown with GPIO, but now can’t find it, can anyone provide information on it?

1 Like

@jack sorry to ping you, but I’m unsure maybe i heared it from another place and spread wrong info. Were there any experiments with turning rock pi on without replugging power supply?

RTC alarm should do that but we haven’t tested it so far. As @Stephen explained above, only works in suspend mode currently. The other way is to assert the power_on signal several seconds with DC on to start booting, but we don’t have power_on signal exported on the GPIO header.

I don’t think RTC will work for me since time i need to turn RockPi4 on highly varies, but i will see. Thank you for answering