NVIDIA Tegra
NVIDIA DRIVE OS 5.1 Linux SDK

Developer Guide
5.1.15 Release


 
CAN Realtime Clock
 
Connecting the RTC Module
Obtaining and Setting the System Time
Note:
The CAN bus must be set to 500Kbit/sec for RTC modules to operate.
If you operate the CAN bus at a different speed, the RTC module will not function.
If the RTC module is attached while the CAN bus is set to a different speed, it will cease TX and RX handling, and must be reset (power cycled) before it can again communicate on the CAN bus.
Consult the Release Notes to identify the supported boards for the release.
On E3550:
The E3550 board includes a CAN Real-Time Clock (RTC) module computer clock to accurately track time. Use the canrtc.sh script to set the RTC module initially to the correct time. The process of setting the module to the correct time, requires:
Obtaining the correct time from the target system.
Setting the correct time in the RTC module.
If the target system is already set to the correct time, then simply set the correct time on the RTC module.
Additionally, the RTC module can be set to automatically set the correct time whenever the platform is booted up.
Connecting the RTC Module
Before getting or setting the RTC module correct time, plug the module into cable harness connector labelled CAN_6_4.
For details on the cable harness connections for the E3550 board, consult Setting Up Your E3550 Platform, Cable Harness topic.
Obtaining and Setting the System Time
Use the canrtc.sh script to obtain, or get, the system time, and then set the time in the RTC module.
To get the system time
On Linux
Use bash shell to launch the canrtc.sh script and get the time as follows:
sudo bash /usr/local/sbin/canrtc.sh get
To set the system time
On Linux
Use bash shell to launch the canrtc.sh script and get the time as follows:
sudo bash /usr/local/sbin/canrtc.sh set
To automatically set the system time at boot
On Linux
If the network is available, run the /etc/systemd/scripts/nv_rtc_sync.sh script at boot to set the system time from the network.
If the network is NOT available, set the system time from the dongle.