question about rtc command

Joel Sherrill joel at rtems.org
Mon Jun 4 14:27:28 UTC 2018


On Mon, Jun 4, 2018 at 9:14 AM, Gedare Bloom <gedare at rtems.org> wrote:

> Indeed, this 'rtc' shell command seems to be a bit of a misnomer. It
> conflates access to two different clocks, the tod and rtc. Probably,
> it would be better to provide a separate 'tod' command that
> reads/writes the tod values, and refactor this 'rtc' to read/write the
> rtc. I'm not quite sure about the correctness of writing to the rtc
> without updating the tod, though.
>

Speaking from RTEMS history here. We tended to use Time of Day
to refer to what RTEMS was maintaining and Real-Time Clock to
review to battery backed clocks that are ICs. This matches Wikipedia's
definition and example of a DS1307.

The driver framework in RTEMS is referred to as RTC but some BSPs
call the driver TOD and name files and directories accordingly.

Renaming TOD drivers to RTC derived names has been on my wish
list for a long time.

>From the command line, the POSIX date command (or a light version)
is available. The rtc shell command should be dealing with the RTC
hardware device. This way you can see RTEMS view of time and the
hardware view. If you have a NTP client, I would think you might like
to see its view of time also.

So the rtc command makes sense if you have a battery backed RTC.
But it often doesn't make sense to even include one in an embedded
system.

This is a case where a man with two watches never really knows what
time it is. :)

Sorry for the historical confusion. But the distinction originally was
pretty clear.

--joel



>
> On Mon, May 28, 2018 at 3:22 AM, jameszxj <jameszxj at gmail.com> wrote:
> > hi all,
> >    rtc command return the current time of day, it seems unreasonable. I
> > think it should return the time of real time clock.
> > Any other reasons to do so?
> > _______________________________________________
> > devel mailing list
> > devel at rtems.org
> > http://lists.rtems.org/mailman/listinfo/devel
> _______________________________________________
> devel mailing list
> devel at rtems.org
> http://lists.rtems.org/mailman/listinfo/devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/devel/attachments/20180604/fe122494/attachment-0002.html>


More information about the devel mailing list