RTC设置目前正常,系统时间同步后重启会恢复之前时间

RTC目前设置与实际时间一致,hwclock -s将rtc时间写入系统时间后,重启系统时间又成2023年了,怎么永久同步?

nvidia@tegra-ubuntu:~$ timedatectl
Local time: Mon 2023-03-27 17:54:19 UTC
Universal time: Mon 2023-03-27 17:54:19 UTC
RTC time: Fri 2024-09-06 14:10:06
Time zone: Etc/UTC (UTC, +0000)
System clock synchronized: no
NTP service: inactive
RTC in local TZ: no

請寫一個systemd service在每次開機的時候執行hwclock -s.

不然系統時間在沒有NTP的情況下預設會使用系統build time做為時間.

好的,已经生效了,谢谢

1 Like

您好,现在还有个问题,短时间上电后发现RTC是正常的运行的,时间也准确,放置时间长后开机会有如下dmesg打印,需要重新配置RTC时间才能生效
[ 8.066061] rtc-rx8010 2-0032: Frequency stop was detected
[ 8.085604] rtc-rx8010 2-0032: Frequency stop detected
[ 8.093718] rtc-rx8010 2-0032: registered as rtc0

直接输入命令timedatectrl和hwclock -s有如下报错打印:
root@tegra-ubuntu:/home/nvidia# timedatectl
[ 53.844826] rtc-rx8010 2-0032: Frequency stop detected
Failed to query server: Failed to read RTC: Invalid argument
root@tegra-ubuntu:/home/nvidia# hwclock -s
[ 76.136930] rtc-rx8010 2-0032: Frequency stop detected
[ 76.142427] rtc-rx8010 2-0032: Frequency stop detected
hwclock: ioctl(RTC_RD_TIME) to /dev/rtc0 to read the time failed: Invalid argument
想请问RTC时间为什么时间长了会消息,需要重新手动设置?

請問這個rx8010是你自己加上的rtc module嗎?

是的,用的是ins5710,i2c已经识别了,但是设置的rtc时间没有了

"Frequency stop detected"看起來是這個 rtc-rx8010本身driver的狀況. 請找這顆的vendor討論

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.