Jetson Orin Nano RTC using a battery not working

i’m working with a Jetson Orin Nano, i tried to use the RTC feature i have connected a ML1220(a rechargeable CR1220) battery to the BBAT pin on the Orin Nano. i have tried to use both /dev/rtc0 and /dev/rtc1. However either one of them doesn’t work. if i run hwclock -r -f /dev/rtc0, it does not return anything. hwclock -w -f /dev/rtc1 always go back to 1970 something(which seems like the default time setting). is there a proper way to setup the RTC?
I tried the solution on https://forums.developer.nvidia.com/t/rtc-cant-hold-time-the-after-system-rebooted-in-l4t-35-1/231889/21 Modify the /lib/udev/rules.d/50-udev-default.rules to make the default RTC to rtc0. Not sure how to achieve the part which modifies kernel configure. RTC can't hold time the after system rebooted in L4T 35.1:

Those solution only for Xavier looks like Orin Nano is different.

Maybe check below topic for referencing.


the BBAT design is similar, however, there is a charging circuit for the battery for my design which charges the battery when the system in powered, would this cause an issue?

As you can find in module data sheet:

PMIC_BBAT
An optional back up battery can be attached to the PMIC_BBAT module input to maintain the module real-time clock (RTC) when VDD_IN is not present. Batteries can be used to power the pin, but charging is not supported.

i understood that charging is not supported, that’s why i added this charging circuit. do you mean that if i use this charging circuit, the RTC wouldn’t work?

You should measure the BBAT pin voltage level to make sure it is always in the requested range to keep RTC working. Also you can try cutting off charging part circuit and use a non-rechargable cell to do cross-check.

sounds good, i will try to cutt off the charging circuit. meanwhile, if this charging circuit is not supported, what can be an alternative solution. change the battery when it is dead or add a external RTC module?

Yes, change battery or use external module.