Hi everyone,
I'm using an i.MX6S on custom hardware and Yocto fido with kernel 3.14.28_1.0.0. If I set the date like this: "date 040314301984" and then run "hwclock --systohc" everything looks good. If I type hwclock after that I get the correct time: Tue Apr 3 14:30:05 1984 0.000000 seconds
However, when I unplug my board and plug it back in, the clock does not keep the correct time.
If I run the poweroff command first, the correct time is kept, but this does not work for our product as the user will not be shutting it down but simply unplugging it.
Does anyone know how to fix this?
Thanks
Marlon
已解决! 转到解答。
For anyone else using Yocto fido, beware that the script hwclock.sh included with busybox gets called several times during startup, and one of those times is called with the argument "stop". This causes the hardware rtc to get overwritten by the system clock before the system clock gets set by the hardware clock, causing the incorrect time to be set.
For anyone else using Yocto fido, beware that the script hwclock.sh included with busybox gets called several times during startup, and one of those times is called with the argument "stop". This causes the hardware rtc to get overwritten by the system clock before the system clock gets set by the hardware clock, causing the incorrect time to be set.
I've determined that the RTC is actually working correctly. It shows the correct time during boot, but further in the boot sequence an incorrect time is shown and the rtc seems to get reset. Now to figure out what's resetting it...