Xavier NX RTC

Hi, we are using an official NX board and want to use the built-in RTC function.
We placed a battery holder on J3 of the carrier board, and use a CR1220 battery.

We get the following results:
Before poweroff time is: 2022-10-23 13:00:00,
then poweroff for 1 hour,
After poweron, the time is still: 2022-10-23 13:00:00

The RTC keeps the last time but not working during the poweroff period.
Do you know why? Does it need any software configurations or any hardware modifications? Thanks!

hello AzureVision,

there’re two RTCs, may I know which one you’re using?
please use rtc1 as the primary RTC, it is the RTC module inside the chip. please see-also [RTC] in Xavier TRM for details.

Hi, we are using rtc1, as the /dev/rtc link to /dev/rtc1
and use these commands:
sudo timedatectl set-local-rtc 0
sudo timedatectl set-local-rtc 1
sudo -s date “10/22/2022 10:30:30”
sudo hwclock -w -f /dev/rtc1
sudo hwclock -r -f /dev/rtc1

@AzureVision

timedatectl cannot control which rtc it is using. It will always use /dev/rtc.

Thus, what you should check is whether /dev/rtc is /dev/rtc1 or /dev/rtc0.

Also, the input value of “sudo timedatectl set-local-rtc” is a boolean value. Not for rtc0 or rtc1.

Hi, the /dev/rtc is already linked to /dev/rtc1, so these commands are controlling the rtc1, is that right?

If we remove the battery, the time will reset every time after the poweroff.
The only issue is it only keeps time instead of clocking.

If we remove the battery, the time will reset every time after the poweroff.

What is the exact error you want to ask here? Reset everytime after power off is a normal behavior if no battery is connected.

Please read the questions first,
Before poweroff time is: 2022-10-23 13:00:00,
then poweroff for 1 hour,
then poweron, the time is still: 2022-10-23 13:00:00
This time it should be 14:00:00 instead of 13:00:00

Is this under the situation with RTC battery or not?

If we are not using the RTC battery but the DC power supply, are we able to see the same issue as what you saw?

If we don’t use battery, or if we are using DC power, then why would we ask?
We have described the situation for many times.

  1. We placed a battery holder on J3 of the carrier board, and use a CR1220 battery.
  2. Power on the board, set time, like 13:00:00
  3. Power off the board, remove the dc power for some time, like 1 hour, with battery on.
  4. Power on the board, get time, then we get 13:00:00 which should be 14:00:00

Hi,

Thanks for explanation. Get your scenario now.

What is the rtc clock time after one hour? I mean read the time from rtc clock node instead of timedatectl.

Will that be correct result or also the wrong one?

Did you measure the voltage level of CR1220 to make sure it can work well? And is the D4 (diode) mounted on your carrier board, as the BBAT supply will be cut off if D4 is not mounted.

Hi Wayne,
We read time using linux command like date, and see the wrong one.

Hi,

Please try to read the date directly from rtc clock and tell us if that also does not meet your expectation or not…
If this is also not correct, then need to check what Trumany said.

Please understand and reply our question first.

Hi Trumany,
D4 is mounted, and we only add the battery holder to the board, don’t make any other changes.
If we remove the battery, the time will reset to the original one like 1970 instead of last power off time, so compare the two different results, we think the battery is working.
We will measure the voltage level of the battery and reply to you later.

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