Reputation: 418
I'm working on a ASUS TinkerBoard, OS Linaro 9.5 - Kernel 4.4.132
I added a little RTC board based on DS3231 chip.
The system creates the device /dev/rtc1 added to /dev/rtc0 and /dev/rtc (link to /dev/rtc0).
I'm able to talk with the RTC chip via i2cdetect and hwclock commands but I have a strange behavior.
This is my tests - of course I'm disconnected from the network to avoid the ntp sync:
WITHOUT RTC: at every power up the board/OS resets the date and time from Nov 03 2016 00:00
WITH RTC:
hwclock -f /dev/rtc1 --systohc
hwclock -f /dev/rtc1 --get
and I have 18:15It seems the system date is restored, the system time is freezed at the power down time, the RTC time is correct but it is not restored to the system time.
Any idea?
Upvotes: 0
Views: 734
Reputation: 2304
You say that /dev/rtc is a link to /dev/rtc0, this means that your kernel is configured with CONFIG_RTC_HCTOSYS_DEVICE
set to rtc0. You can either set it to rtc1 or update your device tree aliases so that the DS3231 becomes rtc0.
The other solution would be to stop relying on the kernel hctosys and use hwclock -f /dev/rtc1 --hctosys
in a startup script.
Upvotes: 1