I’ve just seen an issue on my Verdin iMX8M-Plus + Yavia + Torizon OS 6.8.0-devel-202409+build.26.
Software summary
------------------------------------------------------------
Bootloader: U-Boot
Kernel version: 5.15.148-6.8.0-devel+git.8c5c2dcbf6ba #1-TorizonCore SMP PREEMPT Tue Aug 6 10:01:59 UTC 2024
Kernel command line: root=LABEL=otaroot rootfstype=ext4 quiet logo.nologo vt.global_cursor_default=0 plymouth.ignore-serial-consoles splash fbcon=map:3 ostree=/ostree/boot.1/torizon/999b5fc40c7811c347f06cb4a480a9309d3b94d03db9051f81110ec6fc6ee97c/0
Distro name: NAME="TorizonCore"
Distro version: VERSION_ID=6.8.0-devel-202409-build.26
Distro variant: VARIANT="Docker"
Hostname: verdin-imx8mp-15007389
------------------------------------------------------------
Hardware info
------------------------------------------------------------
HW model: Toradex Verdin iMX8M Plus WB on Verdin Development Board
Toradex version: 0058 V1.1A
Serial number: 15007389
Processor arch: aarch64
------------------------------------------------------------
I try to describe what I see:
use a Yavia board, without the backup battery for RTC. Do not give internet connectivity to the SoM.
load Toradex Easy Installer
install Torizon OS 6.8.0-devel-202409+build.26
at the end of the installation, select “Reboot”
on the Linux console I see the following reboot_log.txt (3.2 KB)
Notice the first messages after kernel start
Starting kernel ...
[ 1.026877] pca953x 3-0021: failed writing register
[ 1.062746] clk: failed to reparent hsio_axi to sys_pll2_500m: -16
after the boot I can query for the date and time (it’s not up-to-date, but I see it)
torizon@verdin-imx8mp-15007389:~$ timedatectl status
Local time: Thu 2022-04-28 17:43:17 UTC
Universal time: Thu 2022-04-28 17:43:17 UTC
RTC time: Fri 2018-03-09 12:36:56
Time zone: Universal (UTC, +0000)
System clock synchronized: no
NTP service: active
RTC in local TZ: no
I remove power from the Yavia board
I connect power again and the SoM boots, with the following boot_log.txt (3.3 KB)
Notice the first message after kernel start
Starting kernel ...
[ 1.027341] rtc-ds1307 0-0032: hctosys: unable to read the hardware clock
[ 1.037872] pca953x 3-0021: failed writing register
[ 1.073066] clk: failed to reparent hsio_axi to sys_pll2_500m: -16
There is a message rtc-ds1307 0-0032: hctosys: unable to read the hardware clock
after the boot I cannot query for datetime anymore, with the following error
torizon@verdin-imx8mp-15007389:~$ timedatectl status
Failed to query server: Failed to read RTC: Invalid argument
This is the stiuation after every boot (after power off) or software reboot.
It seems that RTC works only after a software reboot coming from Toradex Easy Installer.
Hi, I’m the Toradex AI Assistant. The Toradex Support team will follow up with you shortly!
Did you like my answer?
Based on the information provided, it seems like the issue is related to the Real-Time Clock (RTC) on your Verdin iMX8M Plus module when used with the Yavia carrier board and Torizon OS. Here are a few points to consider and potential steps to troubleshoot and resolve the issue:
Backup Battery for RTC:
You mentioned that the Yavia board is used without the backup battery for RTC. The absence of a backup battery means that the RTC will lose its time settings when the power is removed. This could be contributing to the issue.
RTC Driver and Initialization:
The error message rtc-ds1307 0-0032: hctosys: unable to read the hardware clock indicates that the system is unable to read the RTC during boot. This could be due to a driver issue or an initialization problem.
Ensure that the RTC driver is correctly configured and loaded in the kernel. You might need to check the device tree configuration to ensure that the RTC is properly defined.
Kernel Messages:
The messages pca953x 3-0021: failed writing register and clk: failed to reparent hsio_axi to sys_pll2_500m: -16 might be unrelated to the RTC issue but should be investigated as they could indicate other underlying problems.
NTP Service:
Since the system clock is not synchronized (System clock synchronized: no), ensure that the NTP service is active and properly configured. This will help in setting the correct time after boot if the RTC is not functioning correctly.
Software Reboot vs. Power Cycle:
The fact that the RTC works after a software reboot from the Toradex Easy Installer but not after a power cycle suggests that there might be an issue with the initialization sequence during a cold boot.
Steps to Troubleshoot:
Check Device Tree Configuration:
Verify that the device tree correctly defines the RTC. Look for the rtc node in the device tree source (DTS) file and ensure it matches the hardware configuration.
Kernel Configuration:
Ensure that the kernel is configured to support the RTC. Check the kernel configuration (.config file) for options related to the RTC (e.g., CONFIG_RTC_CLASS, CONFIG_RTC_DRV_DS1307).
Add Backup Battery:
If possible, add a backup battery to the Yavia board to maintain the RTC settings across power cycles.
Check Logs:
Review the complete boot logs for any additional clues. Look for any messages related to the RTC or I2C communication errors.
Update Software:
Ensure that you are using the latest version of TorizonCore and U-Boot. There might be fixes or improvements in newer versions that address this issue.
Contact Toradex Support:
If the issue persists, consider reaching out to Toradex technical support for further assistance. Provide them with detailed logs and steps to reproduce the issue.
Conclusion:
The issue seems to be related to the RTC initialization during a cold boot. By checking the device tree configuration, kernel settings, and ensuring proper hardware setup, you might be able to resolve the issue. If these steps do not help, contacting Toradex support with detailed information would be the next best step.
Please, also check if these links can help you solve your problem:
I don’t see anymore the error message rtc-ds1307 0-0032: hctosys: unable to read the hardware clock during the boot
I can query the date and time from Torizon OS
here is what I see
torizon@verdin-imx8mp-15007389:~$ timedatectl status
Local time: Thu 2022-04-28 17:43:05 UTC
Universal time: Thu 2022-04-28 17:43:05 UTC
RTC time: Fri 2018-03-09 12:39:21
Time zone: Universal (UTC, +0000)
System clock synchronized: no
NTP service: active
RTC in local TZ: no
I see a “Local time” different from a “RTC time”.
Not sure if “Local time” is calculated from “RTC time” or from somewhere else
I try to set the desired date and time with sudo date -s '2024-09-11 08:50:00' and then I run timedatectl status and I see
torizon@verdin-imx8mp-15007389:~$ timedatectl status
Local time: Wed 2024-09-11 08:50:02 UTC
Universal time: Wed 2024-09-11 08:50:02 UTC
RTC time: Fri 2018-03-09 12:40:09
Time zone: Universal (UTC, +0000)
System clock synchronized: no
NTP service: active
RTC in local TZ: no
It seems that “Local time” has been updated as expected, but “RTC time” has not.
after a power off + power on of the SoM, I see
torizon@verdin-imx8mp-15007389:~$ timedatectl status
Local time: Thu 2022-04-28 17:42:59 UTC
Universal time: Thu 2022-04-28 17:42:59 UTC
RTC time: Fri 2018-03-09 12:41:55
Time zone: Universal (UTC, +0000)
System clock synchronized: no
NTP service: active
RTC in local TZ: no
and you can see that the date and time have been lost.
As you can see the “RTC time” is couple of minutes greater than the first snapshot (more or less a couple of minutes passed to do my test), but “Local time” is lower than the first snapshot.
How can I set them on Torizon so that RTC keeps them during power off?