RTC cannot save time

I am currently using jetson orin nano for testing. The RTC is powered by an external battery with a voltage of 3V. One problem is that after I use the external battery, I always have to plug and unplug the power supply of the device once and then supply power again before the device can start up normally. The following is my relevant print information

root@ubuntu:~# zcat /proc/config.gz | grep CONFIG_RTC_HCTOSYS_DEVICE
CONFIG_RTC_HCTOSYS_DEVICE=“rtc0”
root@ubuntu:~#
root@ubuntu:~# ls -al /dev/rtc*
lrwxrwxrwx 1 root root 4 Nov 21 2023 /dev/rtc → rtc1
crw------- 1 root root 249, 0 Nov 21 2023 /dev/rtc0
crw------- 1 root root 249, 1 Nov 21 2023 /dev/rtc1
root@ubuntu:~#
root@ubuntu:~#
root@ubuntu:~# dmesg | grep rtc
[ 1.260555] vdd-rtc: supplied by vdd-AO-1v2
[ 1.420149] camchar: rtcpu character device driver loaded
[ 3.923034] tegra_rtc c2a0000.rtc: registered as rtc1
[ 3.928240] tegra_rtc c2a0000.rtc: Tegra internal Real Time Clock
[ 4.078186] nvvrs-pseq-rtc nvvrs-pseq-rtc: registered as rtc0
[ 4.086832] nvvrs-pseq-rtc nvvrs-pseq-rtc: setting system clock to 1970-01-01T00:00:24 UTC (24)
[ 5.867697] tegra186-cam-rtcpu bc00000.rtcpu: Adding to iommu group 6
[ 5.885612] tegra186-cam-rtcpu bc00000.rtcpu: Trace buffer configured at IOVA=0xbff00000
[ 5.899603] tegra-ivc-bus bc00000.rtcpu:ivc-bus: region 0: iova=0xbfec0000-0xbfee01ff size=131584
[ 5.912790] tegra-ivc-bus bc00000.rtcpu:ivc-bus:echo@0: echo: ver=0 grp=1 RX[16x64]=0x1000-0x1480 TX[16x64]=0x1480-0x1900
[ 5.973507] tegra-ivc-bus bc00000.rtcpu:ivc-bus:dbg@1: dbg: ver=0 grp=1 RX[1x448]=0x1900-0x1b40 TX[1x448]=0x1b40-0x1d80
[ 5.985470] tegra-ivc-bus bc00000.rtcpu:ivc-bus:dbg@2: dbg: ver=0 grp=1 RX[1x8192]=0x1d80-0x3e00 TX[1x8192]=0x3e00-0x5e80
[ 5.997331] tegra-ivc-bus bc00000.rtcpu:ivc-bus:ivccontrol@3: ivccontrol: ver=0 grp=1 RX[64x320]=0x5e80-0xaf00 TX[64x320]=0xaf00-0xff80
[ 6.009939] tegra-ivc-bus bc00000.rtcpu:ivc-bus:ivccapture@4: ivccapture: ver=0 grp=1 RX[512x64]=0xff80-0x18000 TX[512x64]=0x18000-0x20080
[ 6.022793] tegra-ivc-bus bc00000.rtcpu:ivc-bus:diag@5: diag: ver=0 grp=1 RX[1x64]=0x20080-0x20140 TX[1x64]=0x20140-0x20200
[ 6.035069] tegra186-cam-rtcpu bc00000.rtcpu: using cam RTCPU IRQ (112)
[ 6.041896] tegra186-cam-rtcpu bc00000.rtcpu: tegra_camrtc_mon_create is successful
[ 6.052772] tegra186-cam-rtcpu bc00000.rtcpu: firmware version cpu=rce cmd=6 sha1=23d74756c4720b2703c3fdde572be7d2b5d3d3ab
[ 6.958480] tegra-camrtc-capture-vi tegra-capture-vi: subdev 13e40000.host1x:nvcsi@15a00000- bound
[ 6.967693] tegra-camrtc-capture-vi tegra-capture-vi: subdev 13e40000.host1x:nvcsi@15a00000- bound

root@ubuntu:~# vi /usr/lib/udev/rules.d/50-udev-default.rules

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

… …

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”

Although rtc is linked to rtc1, when I set the time through hwclock, the time is always synchronized to rtc0
root@ubuntu:/home/nvidia# ls -al /dev/rtc*
lrwxrwxrwx 1 root root 4 Nov 21 2023 /dev/rtc → rtc1
crw------- 1 root root 249, 0 Nov 21 2023 /dev/rtc0
crw------- 1 root root 249, 1 Nov 21 2023 /dev/rtc1
root@ubuntu:/home/nvidia#
root@ubuntu:/home/nvidia#
root@ubuntu:/home/nvidia# sudo date -s “2025-05-13 14:30:00”
Tue 13 May 2025 02:30:00 PM PDT
root@ubuntu:/home/nvidia#
root@ubuntu:/home/nvidia#
root@ubuntu:/home/nvidia# hwclock -w
root@ubuntu:/home/nvidia#
root@ubuntu:/home/nvidia#
root@ubuntu:/home/nvidia# cat /sys/class/rtc/rtc0/date
2025-05-13
root@ubuntu:/home/nvidia#
root@ubuntu:/home/nvidia# cat /sys/class/rtc/rtc1/date
1970-01-01

somebody can help me

Hi,

What is the exact problem here? The rtc that would work here is rtc0 only. We don’t support to use tegra RTC (rtc1).

Does rtc0 hit any issue here?

I configured to use rtc0 to synchronize time in the kernel, but when the power was cut off and the system restarted, the time of rtc0 couldn’t be maintained

Which jetpack release is in use here?

Uploading: image.png…
i used this

Get the BSP version by below command.

cat /etc/nv_tegra_release

R35 (release), REVISION: 6.0, GCID: 37391689, BOARD: t186ref, EABI: aarch64, DATE: Wed Aug 28 09:12:27 UTC 2024

R35 (release), REVISION: 6.0, GCID: 37391689, BOARD: t186ref, EABI: aarch64, DATE: Wed Aug 28 09:12:27 UTC 2024

There should be no software issue in this version. Default setting shall use RTC0 and keep time if RTC circuit is correct.