How to Use RTC on JetPack 5.0.2? | Forecr - Forecr.io

How to Use RTC on JetPack 5.0.2?

Jetson Xavier NX

11 November 2022
WHAT YOU WILL LEARN?

1- Changing RTC Device

2- Changing System Time

3- Setting Up RTC

ENVIRONMENT

Hardware: Jetson Xavier NX - DSBoard-NX2 1.22

OS: JetPack 5.0.2


In this blog post, we will set up the RTC system of Jetson modules with RTC integrated Jetson carrier boards. First, we will change RTC device. Then, we will reboot and change the current time. Finally, we will set up RTC.

Change RTC Device

In order to use RTC which on the board, we need to change RTC device. To change that we need to configure “50-udev-default.rules” file. But first we need to ensure the default RTC device is rtc1. To check that enter given command to the terminal.


ll /dev/rtc*


As seen above, we confirmed that our default device is rtc1.

Then, we need to configure 50-udev-default.rules file.

Open file application and go to file’s direction. It is placed in /usr/lib/udev/rules.d.


Open a terminal here and enter given command to configure this file.


sudo gedit 50-udev-default.rules

Then, change ATTR{hctosys}==“1” to ATTR{hctosys}==“0”.


Save the file and close it. 

Then reboot the module.

After rebooting open a terminal and enter below command to ensure you changed rtc device.


ll /dev/rtc*

As seen above we successfully changed our rtc device.

Change System Time

Plug in an Ethernet cable to connect to internet and take time automatically or configure system time from settings menu.

Set Up RTC

Open a terminal and enter given commands. With these commands we set up rtc time.


sudo hwclock -w -f /dev/rtc0
sudo hwclock -r -f /dev/rtc0


Then, Open file application and go to the directory given below.

/etc/systemd/


Open a terminal here and enter given command to configure this file.


sudo gedit nv.sh

Go to the end of the file and place given command there.


sudo hwclock --hctosys

Save the file and close it.

After this step you can test rtc. Plug out power cable and wait for 5 minutes. Than plug in power cable and you should see the actual time. 


Thank you for reading our blog post.