RTC and "date" command

walter harms wharms at bfs.de
Sat Jun 21 09:37:13 UTC 2008



Midhun A wrote:
> Hi All,
> 
> I am working on Freescale's i.MX21 RTC. I have a driver which does the
> basic initialization of the RTC and sets and reads time from the RTC.
> The RTC is working perfectly fine. When I use the "date" command of
> busybox, it seems that busybox picks up the date and time from
> somewhere else. The time shown by busybox is slower than the RTC time.
> Also all C programs to retrieve system time return the busybox time
> and not the RTC time.
> 
> Does busybox maintain a separate counter by itself ? How do I make
> busybox pick time from the kernel (the one in the RTC) ?
> 


please read adjtime(8). our kernel likely need a good timer unfortunately
the quartz that drive the chip often have trouble to keep the pace.
you can tell the kernel about the (real) frequency by using the adjtimex
command.

beware the clock are very temperature sensitive if you rely on good timekeeping
without a net (ntpclient is your friend here) invest in good quartz crystals.

re,
 wh



More information about the busybox mailing list