Adding External RTC to Jetson Nano via i2c

Dear all,

I understand that the Jetson Nano dev board comes with RTC enabled with the addition of a coin cell battery. However, I am looking to use my own RTC chip on a separate board I design that communicates through I2C.

Is there any way to disable the current RTC in the Kernal or device tree and set up a new RTC with hwclock that communicates through I2C? I am familiar with this on the Raspberry pi platform but have no idea how to do it on the Jetson Nano platform.

Thanks in advance.

You can modify rtc0 to rtc2 in below files to use it.

root@tegra-ubuntu:/lib/udev# grep -ir rtc0 .
./rules.d/50-udev-default.rules:SUBSYSTEM==“rtc”, KERNEL==“rtc0”, SYMLINK+=“rtc”, OPTIONS+=“link_priority=-100”

How would I add the external RTC to be recognize as rtc2 in udev?

Get the the RTC driver from vendor and enable it, it will be registered as rtc2 since rtc0 and rtc1 already there.

The RTC chip I am using is the PCF8523 chip. Looking at /usr/src/linux-headers-4.9.140-tegra-ubuntu18.04_aarch64/kernel-4.9/drivers/rtc/Makefile it seems that the rtc-pcf8523.o (i’m assuming the pcf8523 driver file) object file is already build in the kernel.

How would I then enable it to be rtc2?

Reference to below link to add it to device tree.

Dear all,

We tried to add an external rtc module to the Jetson Nano. The rtc module we want to add is the pcf8523 to i2c-0.

We did the same steps as descripted above. We added the lines for the pcf8523 to the dts file we extracted from the Jetson Nano. Afterwards we compiled the dts into a dtb file.

Then we coppied the dtb file to /boot/dtb and added the following line “FDT </boot/thefile.dtb>” to /boot/extlinux/extlinux.conf.

After rebooting no extra rtc module was added in the /dev. We executed the following command “echo pcf8523 0x68 | tee /sys/class/i2c-dev/i2c-0/device/new_device”. No extra rtc module as created in /dev.

What step do we miss the get the rtc module working?

Thanks in advance.

Hi dieter.vanolmen,

Please help to open a new topic if it’s still an issue. Thanks