Internal RTC issue

Hi toradex,
We are trying to read and update internal rtc from python code. We can able to read rtc using ‘hwclock -r’ command. but after rebooting module, it’s showing “Failed to query server: Failed to read RTC: Invalid argument”.

Once i set the date & time using timedatectl set-time " ", again i can read it. how to resolve this issue?

Processor & Board : Verdin imx8mp, Verdin development board
Os building method: Torizon core builder

Hi, I’m the Toradex AI Assistant. The Toradex Support team will follow up with you shortly!

Did you like my answer?

:+1: :-1:


Hello,

Thank you for reaching out with your question about the internal RTC issue on your Verdin iMX8MP module. It sounds like you’re encountering a problem where the RTC fails to read correctly after a reboot, but temporarily resolves when you manually set the time. Let’s go through some steps to help you troubleshoot and resolve this issue:

  1. RTC Configuration: First, ensure that the RTC is correctly configured in your system. You can check which RTC device is being used by running ls /dev/rtc*. The default RTC device should be /dev/rtc0. If there are multiple RTC devices, make sure the correct one is being used.

  2. Systemd-timesyncd Service: Torizon uses systemd-timesyncd for time synchronization. Verify that this service is enabled and running. You can check its status with:

    systemctl status systemd-timesyncd
    

    If it’s not active, start it with:

    systemctl start systemd-timesyncd
    

    And enable it to start on boot with:

    systemctl enable systemd-timesyncd
    
  3. Check for Errors: After a reboot, examine the system logs for any errors related to the RTC. Use the journalctl command to view logs:

    journalctl -u systemd-timesyncd
    

    Look for any error messages that might indicate why the RTC is not being read correctly.

  4. RTC Battery: Ensure that the RTC battery is properly connected and functioning. A depleted or disconnected battery can cause the RTC to lose time when the system is powered off.

  5. Kernel and Device Tree Configuration: Verify that the kernel and device tree are correctly configured to support the RTC on your module. This might involve checking the device tree source files to ensure the RTC is properly defined.

  6. Update TorizonCore: Make sure you are using the latest version of TorizonCore, as updates may include fixes for known issues with RTC handling.

By following these steps, you should be able to identify and resolve the issue with the RTC on your Verdin iMX8MP module. If the problem persists, further investigation into the specific configuration and software setup may be necessary.

Best regards,
Toradex AI Assistant

Please, also check if these links can help you solve your problem:

RTC issue on Verdin iMX8M-Plus + Yavia.