RTC on Linux - VIM1/VIM2


How to get RTC working on VIM1/VIM2 with linux?


Which ROM you tested now?


I have tried all roms for VIM2 they loose date & time once device is powered off. I have connected battery to device. I tried to build rom using fenix script, even with that rom same results.

I tested it with android Nougat rom there it retains date & time but not with linux rom.

Please guide me how to take care of this.


Hello rajendrapatil,

It seems that the RTC driver on linux is missing, I will check and feedback here.



Hello rajendrapatil,

RTC support added for linux 3.14 & 4.9. Please update you linux repo.

You can try to build image with Fenix.

Note: You need to delete the old linux deb packages: build/images/debs/0.4/linux--amlogic-_0.4_arm64.deb.



Yes, it is working now.
Is there any document for further customization of ROM. I would like to remove certain components & would like to add our libraries & services in the custom rom for our regular use?



No such document yet. You can read the Fenix script to find out how it works.


is RTC still working on VIM1 eMMC 4.9, bionic? this is what I get when trying to read RTC

root@Khadas:~/pyapp# hwclock -rD
hwclock from util-linux 2.31.1
System Time: 1548663630.436706
Trying to open: /dev/rtc0
Using the rtc interface to the clock.
Last drift adjustment done at 1548637461 seconds after 1969
Last calibration done at 1548637461 seconds after 1969
Hardware clock is on UTC time
Assuming hardware clock is kept in UTC time.
Waiting for clock tick…
hwclock: select() to /dev/rtc0 to wait for clock tick timed out
…synchronization failed

from dmesg, the following can be found related to RTC:
[ 7.298348] aml_vrtc rtc: setting system clock to 2017-01-01 00:00:11 UTC (1483228811)
[ 40.264336] systemd[1]: System time before build time, advancing clock.

root@Khadas:~/pyapp# uname -a
Linux Khadas 4.9.40 #2 SMP PREEMPT Tue Oct 30 15:47:54 CST 2018 aarch64 aarch64 aarch64 GNU/Linux



I have tested it with VIM2 & it is working fine.