How to maintain system clock with external RTC

Dear Forum,

We are working on a Jetson Orin Nano/NX custom board with following RTC circuit :

I would like to know how to setup configure the system in order to maintain the system date/time during power shortage, please ? Knowing that I am working on Jetpack-5.1.5 and below is the status of the rtc nodes :

nvidia@JONX-JP515:~ ls /dev/rtc* -l
lrwxrwxrwx 1 root root 4 Thg 6 18 2024 /dev/rtc -> rtc1
crw------- 1 root root 249, 0 Thg 6 18 2024 /dev/rtc0
crw------- 1 root root 249, 1 Thg 6 18 2024 /dev/rtc1

Thanks and best regards,

Khang

Hi khang.l4es,

There’re 2 RTC for Orin series as following:

  1. internal RTC: from Tegra SoC (tegra_rtc) → rtc1
  2. external RTC: from VRS power IC (nvvrs-pseq-rtc) → rtc0

Please connect RTC battery through J3.
If you want to check if the time in RTC is retained after power off, you should configure the time in RTC → perform shutdown/reboot → run “timedatectl status” for details.

Hi @KevinFFF ,

As we are in headless mode and need to access the board via ethernet network (SSH), we first disabled the automatic synchronization from NTP then set the datetime of the clock as in this tutorial https://www.forecr.io/blogs/bsp-development/rtc-test-for-nvidia-jetson-modules

After powering off for a period of time, we saw that it worked by retaining and counting up from the set datetime.

By the way, could you clarify the different btw the internal RTC (rtc0) and external RTC (rtc1), please? It seems that I had a confusion about “external RTC meaning external battery” due to another tutorial about rtc0 found here How to Use RTC on JetPack 5.0.2?

Thanks,

K.

Okay, it seems the time is expected working with RTC in your case currently.

I have mentioned them as following:

  1. internal RTC: from Tegra SoC (tegra_rtc) → rtc1
  2. external RTC: from VRS power IC (nvvrs-pseq-rtc) → rtc0

The internal RTC is from SoC itself while the external RTC is from PMIC mdoule.

Hi @KevinFFF ,

The internal RTC is from SoC itself while the external RTC is from PMIC mdoule.

The PMIC module is not only the battery connected to the PMIC_BBAT pin but rather an external RTC module such as DS3131 and its necessary circuit, is it?

No. PMIC_BBAT is for backing up the PMIC/VRS RTC already on the Orin NX/Nano module, so it does not mean an external RTC module such as DS3131/DS3231 is required.
You would only add an external RTC if you need higher RTC accuracy.