Hwclock and system clock is not sync

cancel
Showing results for 
Search instead for 
Did you mean: 

Hwclock and system clock is not sync

1,001 Views
kumaresang
Contributor I

Hi,

Hwclock date and time and system clock date and time is not syncing on kernel(PCF85263 i2c RTC module).it is getting 1 sec delay.

Example :

root@iWave-G23S:~# date;hwclock
Thu May 9 19:24:35 UTC 2019
Thu May 9 19:24:34 2019 0.000000 seconds.

Thank You

Labels (2)
0 Kudos
8 Replies

559 Views
kumaresang
Contributor I

Dear Victor,

I was tried your solution but another terminal also facing above mentioned issue.

Regards,

Kumaresan G

0 Kudos

559 Views
b36401
NXP TechSupport
NXP TechSupport

So I have no idea why bash shows the time another than "date".
Possibly there is some issue inside bash.

Please try to configure bash to run "date" with every command prompt.
I mean something like this:

PS1="[\$(date +%H:%M:%S)][\u@\h:\w]\$ "

0 Kudos

559 Views
kumaresang
Contributor I

Dear Victor,

After sync hardware clock and system clock 1 sec delay is coming in terminal timestamp and kernel time.

Board Prints:

[2019-05-13 18:25:14.154] root@iWave-G23S:~# hwclock -w;hwclock -s

[2019-05-13 18:20:11.628] root@iWave-G23S:~# date;hwclock
[2019-05-13 18:20:15.717] Mon May 13 18:20:14 UTC 2019
[2019-05-13 18:20:15.723] Mon May 13 18:20:14 2019  0.000000 seconds

Regards,

Kumaresan G

0 Kudos

559 Views
b36401
NXP TechSupport
NXP TechSupport

Please try to run another shell after you change the time.

0 Kudos

559 Views
kumaresang
Contributor I

Dear Victor,

I tried your hwclock -w;hwclock -s, solution it is sync hwclock;date command but,after power on/off and reboot hwclock date and time and system clock date and time is not syncing on kernel.

Regards,

Kumaresan G

0 Kudos

559 Views
b36401
NXP TechSupport
NXP TechSupport

You can add hwclock -s into startup script.

0 Kudos

559 Views
kumaresang
Contributor I

Hii,

Can you suggest crystal oscillator frequency ppm and load capacitor values for PCF85263 RTC IC.

Regards,

Kumaresan G

0 Kudos

559 Views
b36401
NXP TechSupport
NXP TechSupport

You can use "hwclock -w" and "hwclock -s" to synchronize HW and system clocks.

Have a great day,
Victor

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos