From: General m. l. f. g. users.
<gum...@li...> - 2017-09-17 20:44:27
|
I'm having issues with real-time clock synchronization on a gumstix air (or fire) storm. It's possible that this is a more general Linux issue. If I set the date (date -s ... or ntpdate), then write to hwclock: hwclock -w (or hwclock --systohc) and shutdown normally: shutdown -h now when I reboot, the rtc reflects what I set the date/time to. However, if I shut down by loss of battery or sending the GPIO kill signal I have, it does not. Sending the GPIO kill signal is our normal way to shut down. So, our rtc is almost never updated even if I execute: hwclock -w I've also tried doing: hwclock -w sync That doesn't do any good either. In either case, if I read via hwclock, the value reflects my change, but won't survive an "abnormal" shutdown. It appears that the data is being cached and something in the normal shutdown process causes that cache to be written out to the device itself. I looked at the busybox hwclock code (which is what I'm using). It writes to /dev/rtc which is sym linked to /dev/rtc0. Can anyone tell me how to force a write to the RTC? Put differently, what is the normal shutdown process doing that causes the update to truly be made to the RTC? Thanks. -- Sent from: http://gumstix.8.x6.nabble.com/ |