About setting the RTC time

Hi, everyone.
I attached a battery to my custom board to enable the PMIC RTC function.
The battery is working normally.
After I closed the ‘Automatic Date & Time’, and try to set the RTC time, no matter how I set the RTC time, it fails after device reboot.
For example, I use the following command to set RTC time

From the above it seems to work, but after I reboot the device, the RTC time changed back to 1970

Please give me some suggestions to make PMIC RTC effective, thanks


ls -lh /dev/rtc

Please first verify whether your device is using rtc0 as the RTC source.
I think the default one is rtc1, which is integrated into the Tegra Soc itself, and does not have connection to the external battery.

Yes!rtc is pointing to rtc1.
You mean the external battery is connected to rtc0 and the rtc0 is not being used as the RTC source?
Well, how do I set the rtc0 as the RTC source?

YES. Exactly.

You can do it by either changing the udev rule, or by re-building the kernel with customized kernel config.

1 Like

Hi DaveYYY.
Thanks for your solutions.
I tried to config the udev rules, but it failed.
Then, I tried another solution. I made the following changes to tegra_deconfig in the kernel source code
After successfully building the kernel, I replaced the Image file.
Use the following command to recreate the image
sudo BOARDID=3767 BOARDSKU=0003 ./tools/kernel_flash/l4t_initrd_flash.sh --no-flash --external-device nvme0n1p1 -c ./tools/kernel_flash/flash_l4t_external.xml p3509-a02+p3767-0000 external
Then, use the following command to flash the external NVMe storage.
sudo ./tools/kernel_flash/l4t_initrd_flash.sh --flash-only --external-device nvme0n1p1 --direct sdb -c ./tools/kernel_flash/flash_l4t_external.xml p3509-a02+p3767-0000 external
Here is my flash log.
Host_flash_log.txt (14.9 KB)
But after I boot the device for the first time and configure the user and other information, the system desktop stays at the Ubuntu desktop instead of rebooting into the nvidia desktop.

I’ve tried to change the RTC time under this desktop and it seems to work, but how do I get to the nvidia desktop?
Is there something not configured after building the kernel?
Here is my device boot log.
device_boot_log.txt (118.5 KB)


Please keep the HDMI cable plugged in after flashing process completes.
It is a known issue with HDMI hotplug on Orin platforms.

Are you sure this is about HDMI?
I’m doing the same as before replacing the kernel Image file, but I can’t get to the nvidia desktop after replacing the Image file and reflashing it.
I mean after the initial configuration below, shouldn’t the device automatically reboot and go to the nvidia desktop? But mine doesn’t, it stays in Ubuntu desktop


[ 19.186147] WARNING: CPU: 0 PID: 0 at drivers/gpio/gpio-tegra186.c:937 tegra186_gpio_irq+0x1ac/0x1f0
[ 19.195931] —[ end trace 3344c641adfc229f ]—

We’ve seen this issue many times before.
Please just follow what I said earlier.

It hangs because of the IRQ error.

Thank you, the issue about the RTC should be resolved.

1 Like

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