I have a DS3231 on my rPi B 256 MB and I can read and write to the hardware clock OK.
The problem is that there is always an offset between the the system clock and the hwclock of about 0.5 sec. In other words if I set the hwclock with the sysclock and then set the sysclock from the hwclock the sysclock should in theory be unchanged, but in fact it is now ~0.5 sec out.
ntpd is not running. pi is idle >95%. I'm running headless through ssh, if that is of interest.
An example:
root@DietPi:~# ntpdate -b time.nrc.ca
20 Jan 12:02:04 ntpdate[2910]: step time server 132.246.11.227 offset 0.000053 sec <<<<< sys clock now on ntp time
root@DietPi:~# hwclock -w
root@DietPi:~# hwclock -s
root@DietPi:~# ntpdate -b time.nrc.ca
20 Jan 12:03:06 ntpdate[2916]: step time server 132.246.11.227 offset 0.504072 sec <<<<< ~0.5 sec shift in time
The problem is each time the hwclock is set and then sysclock set, the time will move another 0.5 sec each cycle. Do it 10 times and the error is 5 sec.
I was expecting a few (maybe 10s) of ms error to creep in, but 0.5 sec seems a bit high.
I'm using
hwclock from util-linux 2.20.1
the /etc/adjtime file is (no drift corrections applied)
0.000000 1453309355 0.000000
1453309355
UTC
i2c is set at 100KHz, 400KHz doesn't make a difference.
Is this normal? Any way to reduce the round trip error?
thanks,
Gord_W