How to properly drive and initiate m41t83 RTC in Torizon OS device tree

Hi,

I’m using a Colibri-imx8qxp core with our custom carrier board based on the reference design.
We are using M41t83 IC for off core RTC when system down.
Below is the device tree overlay I used to drive m41t83

// M41T83 RTC device tree overlay

/dts-v1/;
/plugin/;

/ {
	compatible = "toradex,colibri-imx8x";
};

&i2c1 {
	/* Replace the existing M41T0M6 RTC with M41T83 */
	rtc_i2c: rtc@68 {
		compatible = "st,m41t83"; 
		reg = <0x68>;
	};
};

After deploy the device tree to core, it failed to setup RTC as rtc0, due to ‘Cant’t clear HT bit’ error:

torizon@colibri-imx8x-06900003:~$ dmesg | grep rtc
[    1.781964] imx-sc-rtc scu:rtc: registered as rtc1
[    2.027362] rtc-m41t80 17-0068: Can't clear HT bit
[    2.032193] rtc-m41t80: probe of 17-0068 failed with error -5
[    2.051006] imx-drm display-subsystem: bound imx-dpu-crtc.0 (ops dpu_crtc_ops)
[    2.051793] imx-drm display-subsystem: bound imx-dpu-crtc.1 (ops dpu_crtc_ops)
[    2.525618] hctosys: unable to open rtc device (rtc0)

Here is the RTC related schematic for reference:

Thanks for your help!

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 M41T83 RTC on your Colibri iMX8QXP module. The error message ‘Can’t clear HT bit’ typically indicates a configuration or communication issue with the RTC device. Here are some steps you can take to troubleshoot and resolve this issue:

  1. Verify Device Tree Overlay:

    • Ensure that the device tree overlay correctly specifies the compatible string for the M41T83 RTC. The line compatible = "st,m41t83"; appears correct, but it’s always good to double-check against the RTC’s datasheet.
    • Confirm that the I2C address (reg = <0x68>;) matches your hardware setup.
  2. Review RTC Initialization:

    • The ‘HT’ bit (Halt Update) in RTCs like the M41T83 is used to halt clock updates. If this bit cannot be cleared, it might indicate a communication issue or that the RTC is not properly initialized.
    • Ensure that the RTC is powered correctly and that any required pull-up resistors on the I2C lines are in place.
  3. Kernel and Driver Support:

    • Verify that the kernel version you are using supports the M41T83 RTC. Check if there are any patches or updates required for the RTC driver.
  4. Test with a Known Good Configuration:

    • If possible, test the RTC with a known good configuration or on a different setup to rule out software configuration issues.

By following these steps, you should be able to identify and resolve the issue with the RTC setup. If the problem persists, reviewing the device tree bindings documentation for the RTC might provide additional insights.

I hope this helps! If you have any further questions, feel free to ask.

Best regards,
Toradex AI Assistant.

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

Torizon RTC and RTC on SOM.

It looks like an I2C communication problem. How are the I2C_RTC_xxx lines connected to the Colibri SOM?