it seems ntpd.service make my rtc setting wrong?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

it seems ntpd.service make my rtc setting wrong?

Jump to solution
1,448 Views
gonewithwind-peter
Senior Contributor I

Hi all,

I am playing maaxboard-mini(i.MX8MM ,yocto sumo, kernel 4.14) with my rtc chip M41T93,

after I set rtc with command: date --set="20210924 20:56:30";hwclock --systohc --utc --rtc=/dev/rtc0 and  read it with "hwchock -r" , the date is right. I make sure the rtc works in this kernel

but after reboot, the date and rtc date that reading with hwclock -r both are wrong(it not shows my compilation time, it shows Aug, 26 XXXX)

and I try to use /sbin/hwclock --hctosys  to get date, the date are same wrong.

 

after I remove ntpd.service at /etc/systemd/system/multi-user.target.wants/ntpd.service to disable it

 

after rebooting and reseting the rtc, and use /sbin/hwclock --hctosys  in bootup script, the rtc works well( the date and rtc sync)

 

it seems ntpd.service make my rtc setting wrong? why?     ( I tried yocto zeus, no this issue)

at the first, I think my rtc not work,Maybe the kernel has issue,but I use a scope to check the timing, I find it seems OK. now I think the issue is from ntpd.service

 

any help?

thanks.

 

please see the log:

cat /var/log/syslog | grep rtc
Aug 26 14:27:51 fortress kernel: [ 1.713541] imx-drm display-subsystem: bound imx-lcdif-crtc.0 (ops lcdif_crtc_ops)
Aug 26 14:27:51 fortress kernel: [ 4.721802] hctosys: unable to open rtc device (rtc0)
Aug 26 14:27:51 fortress kernel: [ 9.033299] rtc-m41t93 spi0.0: rtc core: registered rtc-m41t93 as rtc0

 

 

--

at the first, the log shows :hctosys: unable to open rtc device (rtc0) ,

but finally  rtc-m41t93 spi0.0: rtc core: registered rtc-m41t93 as rtc0

the issue is from there?

 

my yocto sumo and zeus (kernel 4,14 and 5.4) kernel config are same: sync NTP and startup read from rtc

0 Kudos
1 Solution
1,377 Views
AldoG
NXP TechSupport
NXP TechSupport

Hello,

If it still useful for you, it seems that the hwclock and the system clock may not been syncing correctly after reboot, you may try adding the clock synchronization to the startup script, i.e.

hwclock -s

Best regards,
Aldo.

View solution in original post

2 Replies
1,378 Views
AldoG
NXP TechSupport
NXP TechSupport

Hello,

If it still useful for you, it seems that the hwclock and the system clock may not been syncing correctly after reboot, you may try adding the clock synchronization to the startup script, i.e.

hwclock -s

Best regards,
Aldo.

1,364 Views
gonewithwind-peter
Senior Contributor I

Hi @AldoG 

it's useful.

I did the same with :/sbin/hwclock --hctosys   it's well

Thank you very much.

I received your answer as an solution

0 Kudos