RTC battery

I’ve changed:
/lib/udev/rules.d/50-udev-default.rules
from:

SUBSYSTEM=="rtc", ATTR{hctosys}=="1", SYMLINK+="rtc"
SUBSYSTEM=="rtc", KERNEL=="rtc0", SYMLINK+="rtc", OPTIONS+="link_priority=-100"

to this:

SUBSYSTEM=="rtc", ATTR{hctosys}=="0", SYMLINK+="rtc"
SUBSYSTEM=="rtc", KERNEL=="rtc0", SYMLINK+="rtc", OPTIONS+="link_priority=-100"

Now points to rtc0. Because rtc0 still being outdated , I’ve done sudo hwdate -w. Now it has been updated with time from systemdate,which is connected to ntp.

The use case still being for an no-internet network. So I disconnect the internet, wait for a minute and restart.

Now it points to lrwxrwxrwx 1 root root 4 Mar 15 16:04 /dev/rtc → rtc0
crw------- 1 root root 250, 0 Mar 15 16:04 /dev/rtc0
crw------- 1 root root 250, 1 Mar 15 16:04 /dev/rtc1

But now, system date is not being updated from rtc0. If I connect to internet again, system date updates,and match with rtc0. So it looks like rtc0 is tracking correctly. But system doesn’t use it.

Have you also modify the kernel config(CONFIG_RTC_HCTOSYS_DEVICE) to use rtc0?

It is normal behavior that system does not use it automatically. You need to hwclock sync the time by yourself. Or write a script to automatically do that.

ok now I see:

for using AGX Xavier (1500$ machine) clock I have to modify the kernel … myself? I think that is a little too much. Isn’t it? What’s the problem for nvidia to not modify that?

Normal behaviour? Maybe I am missing something, because is the first computer/machine I need to do this. I guess there is a difference, but I don’t know which one.

It is case-by-case. This kernel not only serves AGX Xavier but maybe other platofrm.
Some platforms rtc0 may not be the PMIC RTC.

For the sync time, also try to use “sudo timedatectl set-local-rtc 0” after you modify the rtc to rtc0.

timedatectl shall to the work automatically in each boot.

Automatically if I make a crontab it?

Thank yoy for your answers.

How long this battery should last? If I add cmos battery, do I need additional changes?

Could you provide me document/forum guidance about cmos batteries addition?

Hi, you can calculate the time according to this topic for Xavier: RTC Current consumption in Xavier SOM

It works correctly now with your instructions. I will make a new topic if I don’t get the battery to work correctly.

Thanks!

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