@ShaneCCC
Here is the update. I tried as you suggested but had no success. Below are the details:
In the commands above, you used /dev/rtc0
and rtc1
. So, I checked which one to use.
$ dmesg | grep rtc
[ 0.814461] iommu: Adding device bc00000.rtcpu to group 23
[ 1.000406] vdd-rtc: at 800 mV
[ 1.076839] camchar: rtcpu character device driver loaded
[ 2.057154] max77686-rtc max77620-rtc: rtc core: registered max77620-rtc as rtc0
[ 2.244970] tegra186-cam-rtcpu bc00000.rtcpu: deferring, 14800000.isp is not probed
[ 6.264629] tegra186-cam-rtcpu bc00000.rtcpu: Trace buffer configured at IOVA=0xbff00000
[ 6.337734] tegra-ivc ivc-bc00000.rtcpu: region 0: iova=0xbfee0000-0xbfefffff size=131072
[ 6.338096] tegra-ivc ivc-bc00000.rtcpu:echo@0: echo: ver=0 grp=1 RX[16x64]=0x1000-0x1480 TX[16x64]=0x1480-0x1900
[ 6.338263] tegra-ivc ivc-bc00000.rtcpu:dbg@1: dbg: ver=0 grp=1 RX[1x384]=0x1900-0x1b00 TX[1x384]=0x1b00-0x1d00
[ 6.338386] tegra-ivc ivc-bc00000.rtcpu:dbg@2: dbg: ver=0 grp=1 RX[1x8192]=0x1d00-0x3d80 TX[1x8192]=0x3d80-0x5e00
[ 6.338748] tegra-ivc ivc-bc00000.rtcpu:ivccontrol@3: ivccontrol: ver=0 grp=1 RX[64x320]=0x5e00-0xae80 TX[64x320]=0xae80-0xff00
[ 6.338799] tegra-capture-ivc ivc-bc00000.rtcpu:ivccontrol@3: no priority specified, using 99 as default
[ 6.338877] tegra-ivc ivc-bc00000.rtcpu:ivccapture@4: ivccapture: ver=0 grp=1 RX[512x64]=0xff00-0x17f80 TX[512x64]=0x17f80-0x20000
[ 6.338922] tegra-capture-ivc ivc-bc00000.rtcpu:ivccapture@4: no priority specified, using 99 as default
[ 6.339130] tegra186-cam-rtcpu bc00000.rtcpu: using cam RTCPU IRQ (71)
[ 6.339133] tegra186-cam-rtcpu bc00000.rtcpu: tegra_camrtc_mon_create is successful
[ 6.340174] tegra186-cam-rtcpu bc00000.rtcpu: firmware version cpu=rce cmd=5 sha1=8966ca7b0e527ed98649649b043322724401969c
[ 6.341182] hctosys: unable to open rtc device (rtc1)
$ ll /dev/rtc*
lrwxrwxrwx 1 root root 4 May 10 18:20 /dev/rtc -> rtc0
crw------- 1 root root 252, 0 May 10 18:20 /dev/rtc0
It is confirmed that rtc0
shoud be used. Before setting the hwclock
, I connected internet to get the correct time and followed your steps:
$ timedatectl
Local time: Thu 2023-05-11 10:44:19 JST
Universal time: Thu 2023-05-11 01:44:19 UTC
RTC time: Thu 2023-05-11 01:44:19
Time zone: Asia/Tokyo (JST, +0900)
System clock synchronized: yes
systemd-timesyncd.service active: yes
RTC in local TZ: no
$ sudo timedatectl set-ntp off
$ sudo timedatectl
Local time: Thu 2023-05-11 10:46:32 JST
Universal time: Thu 2023-05-11 01:46:32 UTC
RTC time: Thu 2023-05-11 01:46:33
Time zone: Asia/Tokyo (JST, +0900)
System clock synchronized: yes
systemd-timesyncd.service active: no
RTC in local TZ: no
$ sudo hwclock -r -f /dev/rtc0
2023-05-11 10:47:24.458603+0900
$ sudo shutdown now
I waited approximately 20 minutes and then turned on the device to check the time.
$ timedatectl
Local time: Tue 2022-09-06 12:20:14 JST
Universal time: Tue 2022-09-06 03:20:14 UTC
RTC time: Sat 2000-01-01 01:02:31
Time zone: Asia/Tokyo (JST, +0900)
System clock synchronized: no
systemd-timesyncd.service active: no
RTC in local TZ: no
As you can see, the time is incorrect. Furthermore, the command dmesg | grep rtc
still says unable to open rtc device (rtc1)
as shown below. It is probably the old log.
$ dmesg | grep rtc
[ 0.828527] iommu: Adding device bc00000.rtcpu to group 23
[ 1.001829] vdd-rtc: at 800 mV
[ 1.065482] camchar: rtcpu character device driver loaded
[ 2.006431] max77686-rtc max77620-rtc: rtc core: registered max77620-rtc as rtc0
[ 2.059157] tegra186-cam-rtcpu bc00000.rtcpu: deferring, 14800000.isp is not probed
[ 6.067238] tegra186-cam-rtcpu bc00000.rtcpu: Trace buffer configured at IOVA=0xbff00000
[ 6.140194] tegra-ivc ivc-bc00000.rtcpu: region 0: iova=0xbfee0000-0xbfefffff size=131072
[ 6.140544] tegra-ivc ivc-bc00000.rtcpu:echo@0: echo: ver=0 grp=1 RX[16x64]=0x1000-0x1480 TX[16x64]=0x1480-0x1900
[ 6.140832] tegra-ivc ivc-bc00000.rtcpu:dbg@1: dbg: ver=0 grp=1 RX[1x384]=0x1900-0x1b00 TX[1x384]=0x1b00-0x1d00
[ 6.141058] tegra-ivc ivc-bc00000.rtcpu:dbg@2: dbg: ver=0 grp=1 RX[1x8192]=0x1d00-0x3d80 TX[1x8192]=0x3d80-0x5e00
[ 6.141409] tegra-ivc ivc-bc00000.rtcpu:ivccontrol@3: ivccontrol: ver=0 grp=1 RX[64x320]=0x5e00-0xae80 TX[64x320]=0xae80-0xff00
[ 6.141471] tegra-capture-ivc ivc-bc00000.rtcpu:ivccontrol@3: no priority specified, using 99 as default
[ 6.141574] tegra-ivc ivc-bc00000.rtcpu:ivccapture@4: ivccapture: ver=0 grp=1 RX[512x64]=0xff00-0x17f80 TX[512x64]=0x17f80-0x20000
[ 6.141631] tegra-capture-ivc ivc-bc00000.rtcpu:ivccapture@4: no priority specified, using 99 as default
[ 6.141892] tegra186-cam-rtcpu bc00000.rtcpu: using cam RTCPU IRQ (71)
[ 6.141897] tegra186-cam-rtcpu bc00000.rtcpu: tegra_camrtc_mon_create is successful
[ 6.142883] tegra186-cam-rtcpu bc00000.rtcpu: firmware version cpu=rce cmd=5 sha1=8966ca7b0e527ed98649649b043322724401969c
[ 6.143992] hctosys: unable to open rtc device (rtc1)