ltib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Ltib] date and rtc


From: aydemir kala
Subject: Re: [Ltib] date and rtc
Date: Thu, 17 Feb 2011 11:03:27 +0200

Hi Kevin,

Thank you for your help. I am able to set the date when kernel boot by using on chip rtc. I am going to try using external rtc now.

Best Regards

Not: Could you please look at my blog
http://www.lpclinux.com/Blogs/WebHome
fdi3250 network problem. I could not solve it.I need help.

Best Regards

Aydemir

 
On Wed, Feb 16, 2011 at 8:14 PM, Kevin Wells <address@hidden> wrote:

Hi Aydemir,

 

>I am using fdi3250 board with kernel 2.6.34. My problem is when i read pcf8563 rtc chip by i2cget command it gives different time, when i use date command it gives different time when i do more /proc/dev/rtc it gives different time. When i set the date by date -s "16 Feb 2011 15:29:00"  then the date is working but when i reset the board it gives

It sounds like the on-chip RTC and the external RTC are both enabled in the build. Cat’ing /proc/drivers/rtc dumps the on-chip RTC time, while i2cget pulls data from the external RTC chip. The date command only shows the Linux system time, which may or may not match one of the RTC’s time.

 

The RTC driver node is probably /dev/rtc0. I’m not sure what the pcf8563 driver node is (rtc1?). You might have to manually add the RTC nodes.

 

>for example i set the year 2011 by using i2cset command. When i read date from pcf8563 it gives 2011 but when i read date by using date command it gives 1970.

The date command doesn’t read the hardware RTCs. The kernel will load the system date from a RTC at startup/resume if you have it enabled in the kernel. You can also select which RTC is used to provide the date.

 

After you set the date of the system, you need to transfer the system date to the hardware RTC. You can use the hwclock command to do this. As long as your selected RTC is continuously powered, you should get the correct system time/date at startup from the hardware clock if it’s enabled in the kernel.

 

There is a basic write up on how to use the on-chip RTC here: http://www.lpclinux.com/Forums/ForumLPC32xx0004

 

Kevin

 

 

Sent: Wednesday, February 16, 2011 5:45 AM
To: address@hidden
Subject: [Ltib] date and rtc

 

Hello,

 

I am using fdi3250 board with kernel 2.6.34. My problem is when i read pcf8563 rtc chip by i2cget command it gives different time, when i use date command it gives different time when i do more /proc/dev/rtc it gives different time. When i set the date by date -s "16 Feb 2011 15:29:00"  then the date is working but when i reset the board it gives

address@hidden /root]# date
Thu Jan  1 01:52:40 UTC 1970

address@hidden /]# more /proc/driver/rtc
rtc_time        : 01:47:22
rtc_date        : 1970-01-01
alrm_time        : 06:28:15
alrm_date        : ****-02-07
alarm_IRQ        : no
alrm_pending        : no
24hr                : yes
address@hidden /]# i2cget 0x0 0x51 0x3
WARNING! This program can confuse your I2C bus, cause data loss and worse!
I will read from device file /dev/i2c-0, chip address 0x51, data address
0x03, using read byte data.
Continue? [Y/n] y
0x58

 

for example i set the year 2011 by using i2cset command. When i read date from pcf8563 it gives 2011 but when i read date by using date command it gives 1970.

 

address@hidden /root]# i2cget 0x0 0x51 0x8
WARNING! This program can confuse your I2C bus, cause data loss and worse!
I will read from device file /dev/i2c-0, chip address 0x51, data address
0x08, using read byte data.
Continue? [Y/n] y
0x11
address@hidden /root]# date
Thu Jan  1 02:01:30 UTC 1970 

 

I think linux softtimer, date command of linux can not get the date from pcf8563 rtc timer and can not start counting true time.

 

do you have any suggestions?

 

Thanks alot

 

Best Regards

 

Aydemir

 

 

 

 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]