problem setting RTC.

I’ve got a battery installed on my system for maintaining the real time clock.

I’m running a custom compiled kernel.

During boot, I get:

[ 0.000000] Linux version 2.6.37 (wim@sandisk4gb) (gcc version 4.3.3 (GCC) ) #5 PREEMPT Fri Jan 21 18:38:17 UTC 2011
[ 0.000000] CPU: ARMv7 Processor [411fc083] revision 3 (ARMv7), cr=10c53c7f
[ 0.000000] CPU: VIPT nonaliasing data cache, VIPT nonaliasing instruction cache
[ 0.000000] Machine: OMAP3 Beagle Board
[ 0.000000] Memory policy: ECC disabled, Data cache writeback
[ 0.000000] OMAP3430/3530 ES3.1 (l2cache iva sgx neon isp )
[ 0.000000] SRAM: Mapped pa 0x40200000 to va 0xfe400000 size: 0x10000
[ 0.000000] Built 1 zonelists in Zone order, mobility grouping on. Total pages: 65024
[ 0.000000] Kernel command line: console=ttyO2,115200n8 mpurate=720 buddy=none camera=lbcm3m1 vram=12M omapfb.mode=dvi:640x480MR-16@60 omapdss.def_disp=dvi root=/dev/mmcblk0p2 rw rootfstype=ext3 rootwait
[ 0.000000] OMAP3 Beagle Rev: C4
[ 2.746765] twl_rtc twl_rtc: rtc core: registered twl_rtc as rtc0

[ 2.840026] twl_rtc twl_rtc: setting system clock to 2011-01-21 18:47:05 UTC (1295635625)

It’s obviously reading the time correctly at boot, but the time has drifted off what I’d like it to be set to.

~ # hwclock --show ; date
Tue Jan 25 19:31:30 2011 0.000000 seconds
Tue Jan 25 19:35:30 UTC 2011

shows me that it’s not the same as the current running time.

~ # hwclock --systohc
~ # hwclock --show ; date
Tue Jan 25 19:32:40 2011 0.000000 seconds
Tue Jan 25 19:36:41 UTC 2011

I think that the command ‘hwclock --systohc’ should have set the hwclock to match the system time, but it hasn’t been affected. I’ve tried using the ‘-f /dev/rtc0’ option but that hasn’t worked either.

Obviously at some point in the past I’ve been able to write to the clock, as it’s close to correct, but I can’t figure out what I’m doing wrong now. I know that I’ve updated my angstrom distribution in the past few months with ‘opkg update && opkg upgrade’

Any help is appreciated.

Wim.