Atmel website | ARM Community | AVR freaks | Technical Support
Banner
 FAQ •  Search •  Register •  Login 

All times are UTC + 1 hour [ DST ]




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: SOLVED: rtc0 not preset with hwclock
PostPosted: Fri Jun 03, 2011 10:03 pm 
Offline

Joined: Wed Mar 11, 2009 4:13 pm
Posts: 14
Hi
I have an issue in AT91SAM9XE-EK with linux 2.6.27 with rtc0:

dmesg message:

<7>at91_rtt: dev (254:0)
<6>rtc-at91sam9 at91_rtt.0: rtc core: registered at91_rtt as rtc0
<4>rtc-at91sam9 at91_rtt.0: rtc0: SET TIME!

If I try to adjust the rtc0:

root@at91sam:/sbin$ date
Fri Jun 3 16:59:12 UTC 2011
root@at91sam:/sbin$ hwclock -w
root@at91sam:/sbin$ hwclock -r
hwclock: Could not read time from RTC: Invalid or incomplete multibyte or wide character

Anybody found this kind of error in rtc0 already? If so, how to fix this? Thanks.


Last edited by serkam on Wed Jun 15, 2011 11:49 pm, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: rtc0 not preset with hwclock
PostPosted: Sun Jun 05, 2011 4:27 pm 
Offline

Joined: Tue May 31, 2011 9:43 am
Posts: 4
try to get other hwclock (from last version busybox).
I had this problem with an old version busybox


Top
 Profile  
 
 Post subject: SOLVED: rtc0 not preset with hwclock
PostPosted: Wed Jun 15, 2011 11:45 pm 
Offline

Joined: Wed Mar 11, 2009 4:13 pm
Posts: 14
Hi

Thanks to GehardF, another user of this forum, I could fix the problem of rtc0.

The RTC is a sum of gpbr[0] ( General Purpose Backup Register ) and the counter of RTT. The result is a 32 bits UNIX timestamp.

The origin of the issue, came from WRONG address of AT91C_SYS_GPBR that is 0xFFFFFD50 and MUST BE 0xFFFFFD60 in AT91SAM9XE512.h ( at91lib ) and at91sam6260.h ( linux kernel ). HelloOOoo Atmel tech team. Weak up!

The linux driver of RTC of AT91SAM test the content of gpbr[0] and if is zero, it returns a error code, that results in "...SET TIME!" console message. With this error code, the linux does not continue the rtc process. As the gpbr address is wrong, the driver access a nonexistent register and reads ZERO. This is why hwclock shows that error. This is why I couldn't do anything to setup or read rtc0.

So, simply correcting the *.h listed above, all issues are fixed.

Now, I can get hwclock operating flawlessly and rtc0 is updating perfectly the date in linux at boot.

Best Regards for all.


Top
 Profile  
 
 Post subject: Re: SOLVED: rtc0 not preset with hwclock
PostPosted: Tue Mar 13, 2012 9:25 pm 
Offline

Joined: Wed Jun 22, 2011 6:25 pm
Posts: 3
I have the same problem, where did you re-compile at91lib from?
SAM-BA applets or in the openembedded source?

Thanks in advance


Top
 Profile  
 
 Post subject: Re: SOLVED: rtc0 not preset with hwclock
PostPosted: Wed Mar 14, 2012 2:37 pm 
Offline

Joined: Wed Mar 11, 2009 4:13 pm
Posts: 14
Jimmy

You must recompile the kernel.

Edit AT91SAM9XE512.h with correct address and recompile the kernel.

To recompile kernel, follow instruction from Atmel.

Good luck.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: Bing [Bot] and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron