AGX Orin RTC not working after rebooting it is starting with 21 April 2022

Hi Team ,
I am using Orin AGX dev kit module. In this RTC not working. Mounted proper 3V cell . Every reboot it is starting with 21 April 2022 . Attached logs for some command response to help guiding us.

====================================
nvidia@nvidia-desktop:~$ sudo i2cdump -y 0 0x50
No size specified (using byte-data access)
0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
00: 02 00 fe 00 00 00 00 00 00 00 00 00 00 00 00 00 ?.?..
10: 00 00 00 0a 36 39 39 2d 31 33 37 30 31 2d 30 30 …?699-13701-00
20: 30 30 2d 35 30 30 20 48 2e 30 00 00 00 00 00 00 00-500 H.0…
30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 …
40: 00 00 00 00 6e 83 78 2d b0 48 31 34 32 31 31 32 …n?x-?H142112
50: 32 31 30 39 36 37 33 00 00 00 00 00 00 00 00 00 2109673…
60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 …
70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 …
80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 …
90: 00 00 00 00 00 00 4e 56 43 42 00 00 4d 31 00 00 …NVCB…M1…
a0: 00 00 00 00 00 00 00 00 00 00 00 00 6e 83 78 2d …n?x-
b0: b0 48 0a 00 00 00 00 00 00 00 00 00 00 00 00 00 ?H?..
c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 …
d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 …
e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 …
f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 85 …?
nvidia@nvidia-desktop:~$
nvidia@nvidia-desktop:~$ ls -al /dev/rtc*
lrwxrwxrwx 1 root root 4 Apr 21 18:24 /dev/rtc → rtc0
crw------- 1 root root 250, 0 Apr 21 18:24 /dev/rtc0
crw------- 1 root root 250, 1 Apr 21 18:24 /dev/rtc1
nvidia@nvidia-desktop:~$ sudo timedatectl set-time ‘2022-12-17 13:41’
nvidia@nvidia-desktop:~$ date
Saturday 17 December 2022 01:41:03 PM IST
nvidia@nvidia-desktop:~$ sudo hwclock -r -f /dev/rtc1
[sudo] password for nvidia:
1970-01-01 05:45:51.629109+05:30
nvidia@nvidia-desktop:~$ sudo hwclock -r -f /dev/rtc0
2022-12-17 13:41:27.440697+05:30
nvidia@nvidia-desktop:~$ timedatectl set-ntp 0
==== AUTHENTICATING FOR org.freedesktop.timedate1.set-ntp ===
Authentication is required to control whether network time synchronization shall be enabled.
Authenticating as: nvidia, (nvidia)
Password:
==== AUTHENTICATION COMPLETE ===
nvidia@nvidia-desktop:~$ date
Saturday 17 December 2022 01:42:05 PM IST
nvidia@nvidia-desktop:~$ i2cget -f -y 4 0x3c 0x01
0x81
nvidia@nvidia-desktop:~$ hwclock --verbose
hwclock from util-linux 2.34
System Time: 1671264842.705772
Trying to open: /dev/rtc0
No usable clock interface found.
hwclock: Cannot access the Hardware Clock via any known method.
nvidia@nvidia-desktop:~$ cat /lib/udev/rules.d/50-udev-default.rules

do not edit this file, it will be overwritten on update

run a command on remove events

ACTION==“remove”, ENV{REMOVE_CMD}!=“”, RUN+=“$env{REMOVE_CMD}”
ACTION==“remove”, GOTO=“default_end”

SUBSYSTEM==“virtio-ports”, KERNEL==“vport*”, ATTR{name}==“?*”, SYMLINK+=“virtio-ports/$attr{name}”

select “system RTC” or just use the first one

SUBSYSTEM==“rtc”, ATTR{hctosys}==“0”, SYMLINK+=“rtc”

SUBSYSTEM==“rtc”, KERNEL==“rtc0”, SYMLINK+=“rtc”, OPTIONS+=“link_priority=-100”
RTC_cmd_logs.txt (3.1 KB)

Hi vardhanman.k,

There’s a thread about RTC issue in L4T 35.1.
Please refer to check if it could help.
RTC can't hold time the after system rebooted in L4T 35.1

Thanks @KevinFFF it is worked for me as below steps.
My changes are

  1. CONFIG_RTC_HCTOSYS_DEVICE=“rtc0” in tegra_defconfig
    image
  2. modification done at “…rootfs/usr/lib/udev/rules.d/50-udev-default.rules” in build machine or in target “/lib/udev/rules.d/50-udev-default.rules”
  3. soft link changed rtc1 to rtc0
    $cd /dev/
    $ln -sf rtc0 rtc
  4. set date and sync to rtc
    $date -s ‘2022-12-17 10:16:00’
    $sudo hwclock --systohc
  5. reboot/power off and test
1 Like
  1. CONFIG_RTC_HCTOSYS_DEVCE =“rtc0” ? this step how to change? rebuild the kernel ?

    now . my RTC (rtc0) is OK . how to set OS time with the RTC time . after reboot?

@yumeng5112

  1. “CONFIG_RTC_HCTOSYS_DEVCE” is available at “source/public/kernel/kernel-5.10/arch/arm64/configs/tegra_defconfig”
  2. after set time execute “sudo hwclock --systohc” to save system time into hwclock

Hi,

Please refer to this post. It is same issue as yours and I have explained the reason why it keeps going back to 4/21/2022.

This rule is from upstream ubuntu (systemd-timesyncd).

The issue here is . no connect internet . how to get rtc0 time, and set this time to ubuntu OS time. NOW. only run a script (hwclock -s) in each reboot. CAN fixed it! . if no connect interne . rtc1 always 1970.01.01. in each reboot . rtc0 is working OK, in each reboot!

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