2008-08-19 23:22:20     RTC missing setting after reboot

Document created by Aaronwu Employee on Aug 7, 2013
Version 1Show Document
  • View in full screen mode

2008-08-19 23:22:20     RTC missing setting after reboot

DAVID ZHOU (CHINA)

Message: 60702   

 

Hi all,

 

My board have set   RTC battery and clock also enable rtc-bfin driver. But  when I use date command to set the system time, but after reboot  my set is missing, here is my example:

 

root:/> date

Wed Feb 17 03:15:50 UTC 1993

root:/> date -s 082000002008

Wed Aug 20 00:00:00 UTC 2008

root:/> reboot

 

after reboot:

 

root:/> date

Wed Feb 17 03:17:12 UTC 1993

root:/>

 

Can anyone help me to resolve it ? Or are there any wrong operation of me?

 

Thanks ! My version is the 2008 RC8 release.

 

 

QuoteReplyEditDelete

 

 

2008-08-19 23:32:39     Re: RTC missing setting after reboot

Mike Frysinger (UNITED STATES)

Message: 60704   

 

you are setting the *system* clock, not the *hardware* clock

 

you have to use the hwclock command to set the hardware clock

QuoteReplyEditDelete

 

 

2008-08-19 23:38:24     Re: RTC missing setting after reboot

DAVID ZHOU (CHINA)

Message: 60705   

 

Thanks Mike!

 

But if we need to make my blackfin linux's system time saved and like the PC---- reboot and power-off do not affect the system time, how should I do?

QuoteReplyEditDelete

 

 

2008-08-19 23:49:53     Re: RTC missing setting after reboot

DAVID ZHOU (CHINA)

Message: 60706   

 

Thanks Mike! It can works now! Just using hwclock command.

QuoteReplyEditDelete

 

 

2008-08-19 23:58:31     Re: RTC missing setting after reboot

Mike Frysinger (UNITED STATES)

Message: 60707   

 

the Blackfin works exactly like your PC

QuoteReplyEditDelete

 

 

2008-08-20 05:14:18     Re: RTC missing setting after reboot

Appalayagari Sreedhar (INDIA)

Message: 60744   

 

Hi David and Mike,

 

Can you tell me the syntax how you have stored persistently the RTC date and time after reboot also.

 

i tried with command

 

date -s 082012302008

 

hwclock -w

 

but after reboot it is not showing the correct time, it is resetting to 1Jan 1970 00000

 

Can you tell how to use the syntax properly.

 

Best Regards,Sreedhar.

QuoteReplyEditDelete

 

 

2008-08-20 09:27:25     Re: RTC missing setting after reboot

Mike Frysinger (UNITED STATES)

Message: 60753   

 

*what* is not showing the correct time ?

QuoteReplyEditDelete

 

 

2008-08-21 09:07:52     Re: RTC missing setting after reboot

Appalayagari Sreedhar (INDIA)

Message: 60831   

 

Hi Mike,

 

hwclock. values are not correct.

 

in our custom board we dont have battery to power the RTC. only AC power.

 

on power up the RTC values will be invalid.

 

Mike and David,

 

we are issuing system("hwclock") it is giving following error.

 

hwclock not found, we need to enable some application or missing any header file inclusion.

 

Best Regards,Sreedhar.

 

 

QuoteReplyEditDelete

 

 

2008-08-21 09:22:47     Re: RTC missing setting after reboot

Robin Getz (UNITED STATES)

Message: 60833   

 

Sreedhar:

 

I'm not sure what you expect?

 

If you don't have the RTC connected properly (crystal/power) - the software is not going to work.

 

hwclock is an optional feature of busybox - you need to make sure you turn it on for it to be included. Can you run it from the command line?

 

-Robin

 

 

QuoteReplyEditDelete

 

 

2008-08-21 11:04:08     Re: RTC missing setting after reboot

Appalayagari Sreedhar (INDIA)

Message: 60844   

 

Hi Robin,

 

Thankyou very much. We have the crystal mounted on the custom board. but no battery.

 

Best Regards,Sreedhar.

QuoteReplyEditDelete

 

 

2008-08-21 11:16:11     Re: RTC missing setting after reboot

Mike Frysinger (UNITED STATES)

Message: 60846   

 

then like Robin said, the RTC is not going to retain its values across reset.  there is nothing you can do in software to work around it.  you might as well just disable the RTC driver since it wont be doing anything useful.

Attachments

    Outcomes