External RTC m41t0 (Colibri IMX8X - torizon-core-docker-colibri-imx8x-Tezi_5.7.2)

Hi,

We have configured I2C-2 for external RTC m41t0 like below.

device-trees/dts-arm64/imx8x-colibri-eval-v3.dtsi
&i2c2 {
status = “okay”;

/* M41T0M6 real time clock on carrier board */
rtc_i2c: rtc@68 {
	compatible = "st,m41t0";
	reg = <0x68>;
	status = "okay";
};

};

We are getting the below error. Could you please help us in this regard.

dmesg | grep rtc
[ 1.720996] imx-sc-rtc scu:rtc: registered as rtc1
[ 2.916452] rtc-ds1307: probe of 17-0068 failed with error -110
[ 2.933334] imx-drm display-subsystem: bound imx-dpu-crtc.0 (ops dpu_crtc_ops)
[ 2.933898] imx-drm display-subsystem: bound imx-dpu-crtc.1 (ops dpu_crtc_ops)
[ 2.992258] imx-drm display-subsystem: bound imx-dpu-crtc.0 (ops dpu_crtc_ops)
[ 2.992529] imx-drm display-subsystem: bound imx-dpu-crtc.1 (ops dpu_crtc_ops)
[ 3.054363] hctosys: unable to open rtc device (rtc0)

~$ sudo i2cdetect -y 17
sudo i2cdetect -y 17
Password:
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f
10: 10 11 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f
20: 20 21 22 23 24 25 26 27 28 29 2a 2b 2c 2d 2e 2f
30: – – – – – – – – 38 39 3a 3b 3c 3d 3e 3f
40: 40 41 42 43 44 45 46 47 48 49 4a 4b 4c 4d 4e 4f
50: – – – – – – – – – – – – – – – –
60: 60 61 62 63 64 65 66 67 68 69 6a 6b 6c 6d 6e 6f
70: 70 71 72 73 74 75 76 77

Thank you!

Hi, I’m the Toradex AI Assistant. I’m in early beta, and I would appreciate your feedback.
The Toradex Support team will follow up with you shortly!

Did you like my answer?

:+1: :-1:


Hello,

The error message you’re encountering, rtc-ds1307: probe of 17-0068 failed with error -110, suggests a communication issue with the RTC device at address 0x68 on the I2C bus. Error -110 corresponds to a timeout, indicating that the kernel did not receive an acknowledgment from the device. This could be due to several reasons, such as incorrect wiring, the device not being powered, or an incorrect I2C bus address in the device tree.

Here are some steps to troubleshoot and potentially resolve the issue:

  1. Verify Hardware Connections: Ensure that the RTC module is correctly connected to the I2C-2 bus and that it is powered correctly. Double-check the SDA and SCL lines for proper connection and pull-up resistors.

  2. Check I2C Bus Number: The command sudo i2cdetect -y 17 suggests you are trying to detect devices on I2C bus number 17, which seems unusual. Typically, I2C bus numbers are lower. Use i2cdetect -l to list all I2C adapters and identify the correct bus number for I2C-2. Then, use i2cdetect -y <bus_number> with the correct bus number to scan for devices.

  3. Device Tree Configuration: Ensure that the device tree changes are correctly applied. You might need to recompile the device tree and ensure that the updated device tree is used by the system. Verify that the I2C bus (i2c2) is enabled and correctly configured in the device tree.

  4. Check for Conflicts: Ensure there are no conflicts with other devices on the same I2C bus. If there are other devices connected, temporarily disconnect them to isolate the issue.

  5. Kernel Configuration: Ensure that the kernel is configured with support for the M41T0 RTC device. The driver for the M41T0 (CONFIG_RTC_DRV_M41T80) should be enabled in the kernel configuration.

  6. Software Versions: Ensure that you are using a compatible version of the Linux kernel and device tree with your hardware. Sometimes, specific versions of hardware require particular kernel versions or patches for full compatibility.

  7. Debugging: Increase the kernel log level for I2C and RTC subsystems to get more detailed logs that might provide further insight into the issue. This can be done by modifying the kernel boot parameters (e.g., `dmesg -

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

Basic Linux Commands | Toradex Developer Center.

Now we have applied the below settings in device tree.

	pinctrl_i2c2: i2c2grp {
		fsl,pins = <
			IMX8QXP_MIPI_DSI1_GPIO0_00_ADMA_I2C2_SCL	0x06000021	/* SODIMM 196 */
			IMX8QXP_MIPI_DSI1_GPIO0_01_ADMA_I2C2_SDA	0x06000021	/* SODIMM 194 */
		>;
	};

now with above rtc0 driver is registered and we got below error.
Please suggest us regarding below

dmesg | grep rtc
[ 1.714663] imx-sc-rtc scu:rtc: registered as rtc1
[ 1.894533] rtc-ds1307 17-0068: oscillator failed, set time!
[ 1.894669] rtc-ds1307 17-0068: registered as rtc0
[ 1.908403] imx-drm display-subsystem: bound imx-dpu-crtc.0 (ops dpu_crtc_ops)
[ 1.908958] imx-drm display-subsystem: bound imx-dpu-crtc.1 (ops dpu_crtc_ops)
[ 1.969125] imx-drm display-subsystem: bound imx-dpu-crtc.0 (ops dpu_crtc_ops)
[ 1.969420] imx-drm display-subsystem: bound imx-dpu-crtc.1 (ops dpu_crtc_ops)
[ 2.044294] rtc-ds1307 17-0068: hctosys: unable to read the hardware clock

Your i2cdetect dump looks like you have some I2C memory on the same address like RTC, perhaps some memory chip with lots of addresses occupied. Could you try booting with RTC not connected. You should see – dashes instead of 68 in i2cdetect dump. If you still get 68 without RTC, then its address is already used for some other device, won’t work until you resolve address space issue.