hwclock --systohc doesn't update RTC on nano

Dear All,

I cannot write RTC on nano. hwclock --systohc dosn’t work on
my environment. Please tell me the right way to write RTC.

I use Jetpack 4.2.2.

The console log is below.

Thanks in advance.

Local time: Thu 2019-10-31 16:24:54 JST
Universal time: Thu 2019-10-31 07:24:54 UTC
RTC time: Sat 2000-01-01 07:34:02
Time zone: Asia/Tokyo (JST, +0900)
System clock synchronized: no
systemd-timesyncd.service active: yes
RTC in local TZ: no

sudo hwclock --show
2000-01-01 16:34:24.373449+0900

sudo hwclock --systohc --debug
hwclock from util-linux 2.31.1
System Time: 1572506741.221264
Trying to open: /dev/rtc0
Using the rtc interface to the clock.
Last drift adjustment done at 1572506686 seconds after 1969
Last calibration done at 1572506686 seconds after 1969
Hardware clock is on UTC time
Assuming hardware clock is kept in UTC time.
1572506741.500000 is close enough to 1572506741.500000 (0.000000 < 0.001000)
Set RTC to 1572506741 (1572506741 + 0; refsystime = 1572506741.000000)
Setting Hardware Clock to 07:25:41 = 1572506741 seconds since 1969
ioctl(RTC_SET_TIME) was successful.
Not adjusting drift factor because the --update-drift option was not used.
New /etc/adjtime data:
0.000000 1572506741 0.000000

sudo hwclock --show
2000-01-01 16:34:53.010378+0900

Could you try below.

sudo timedatectl set-ntp no
sudo timedatectl set-time ‘2019-10-31 16:24’
sudo hwclock

1 Like

Hello ShaneCCC,

Thank you for your suggestion.
It works fine for me.