Hello !
I’m developing on the Verdin iMX8MP SOM with the Dahlia carrier board, running Zephyr OS on the Cortex-M7 core. I need to connect an ST LSM6DSR IMU to I2C3 on the M7 side, but I’m encountering build errors when trying to enable and bind the sensor node in the device tree.
For now, the only change to the device tree I made that at least didn’t raise errors and got compiled correctly is this one in the file nxp_imx8ml_m7.dtsi:
i2c3: i2c@30a40000 {
compatible = “nxp,ii2c”;
label = “I2C_3”;
pinctrl-0 = <&pinmux_i2c3>;
pinctrl-names = “default”;
#address-cells = <1>;
#size-cells = <0>;
reg = <0x30a40000 0x10000>;
interrupts = <37 0>;
clocks = <&ccm IMX_CCM_I2C3_CLK 0 0>;
clock-frequency = <400000>;
status = “disabled”;
};
With this one in the file imx8mp_evk_mimx8ml8_m7.dts:
&i2c3 {
status = “okay”;
st_lsm6dsr: lsm6dsr@6b {
compatible = “st,lsm6dsr”;
reg = <0x6b>;
status = “okay”;
};
};
But when i boot my m7, it says:
[00:00:00.000,000] LSM6DSR: Failed to initialize sensor bus
*** Booting Zephyr OS build v4.1.0-4112-g6e34acc4e296 ***
i2c_reg_read_byte rc=-88 who=0xff
sensor: device not ready.
So I guess it doesn’t really work ?
Specifically, I’d like to know:
Support for I²C3 on M7
- Is I²C3 exposed and enabled in your Zephyr BSP for use by the M7 core?
- Are there any known restrictions or configuration steps (clock, pinmux, domain permissions) required to bring up I²C3 under Zephyr/M7?
LSM6DSR Device Tree Binding
- Does Toradex provide an example overlay or board DTS snippet showing how to declare a custom I²C bus (e.g. I²C3) and attach an st,lsm6dsr node under Zephyr?
- If not, could you point me to any reference that demonstrates adding a new I²C sensor on the M7 in your BSP?
Recommended Workflow
- Any guidance on the proper order of steps (e.g. enabling the bus in the board DTS, adding clocks, assigning labels, etc.) to get a basic “device ready” for I²C3 in Zephyr would be extremely helpful.
One last thing, I’m using the lsm6dsl zephyr sample where i simply replaced every occurence of lsm6dsl by lsm6dsr and the whoami value from 6a to 6b.
I appreciate any examples or pointers you can share to confirm whether this use case is supported and how best to configure it. Thank you!
Hi, I’m the Toradex AI Assistant.
I might make mistakes. Our support team will step in if needed. If I answered your question, please tick the “Solution” checkbox. For follow-up questions to me, please use @ToradexAI in your post.
Did you like my answer?

Hello!
Thank you for your detailed description of your setup and the challenges you’re facing. I’ll address your questions step-by-step and provide some Zephyr development best practices for the Verdin iMX8MP SOM (Dahlia board) running Zephyr on the Cortex-M7.
1. I²C3 Support on M7
2. LSM6DSR Device Tree Binding
- Device Declaration: Your device tree snippet is structurally correct for Zephyr, but ensure the syntax and labels match what Zephyr expects. The compatible for LSM6DSR should correspond to a driver in Zephyr. If you created a simple alias by copying lsm6dsl and replacing names, make sure the Kconfig and driver C files are properly adapted and built.
Example snippet:
&i2c3 {
status = "okay";
st_lsm6dsr: lsm6dsr@6b {
compatible = "st,lsm6dsr";
reg = <0x6b>;
status = "okay";
};
};
- Make sure you have enabled the LSM6DSR driver in your prj.conf:
CONFIG_LSM6DSR=y
CONFIG_I2C=y
(If you’re using a slightly modified version of lsm6dsl, be sure to adjust accordingly.)
3. Workflow for I²C3 in Zephyr (Summary Steps)
A. Device Tree
- Define and enable i2c3 in your SoC’s .dtsi (as you did).
- Ensure pinmux is specified and correct.
- In your board’s .dts or overlay, mark i2c3 as “okay”.
- Add your LSM6DSR sub-node with correct address and compatible string.
B. Permissions & Clocks
- Make sure the clock bindings in device tree (clocks = <&ccm …>) are accurate and that these clocks are not also managed by Linux.
- Configure RDC (resource domain controller) so M7 has access to the I²C3 peripheral.
C. prj.conf
- Enable all relevant drivers and I2C framework options.
- If using custom drivers, adjust driver Kconfig and source registration.
D. Build and Debug
- Confirm the device tree and .conf files are being picked up by the build.
- Enable verbose logging for I2C/LSM6DSR to see if the device is probed at boot.
- If you receive “device not ready”, look earlier in the log for “I2C: device not ready” or “I2C: failed to init” messages.
4. Diagnostics for Your Error
Your error:
LSM6DSR: Failed to initialize sensor bus
i2c_reg_read_byte rc=-88 who=0xff
sensor: device not ready.
- rc = -88 suggests the I2C bus is not responding—commonly due to one of:
- The pinmux or peripheral clock is missing.
- Linux still holds the I2C3 peripheral.
- The sensor is not on the expected address, or communication lines are inactive.
5. Extra Notes & References
Example Overlay for Zephyr (Summary)
/ {
aliases {
i2c-3 = &i2c3;
};
};
&i2c3 {
status = "okay";
clock-frequency = <I2C_BITRATE_FAST>; // or use value 400000
pinctrl-0 = <&your_custom_pins>;
pinctrl-names = "default";
lsm6dsr@6b {
compatible = "st,lsm6dsr";
reg = <0x6b>;
status = "okay";
};
};
Checklist:
- Is I2C3 enabled and accessible by M7 (Linux not holding it)?
- Is RDC configured so M7 can access the peripheral?
- Are proper clocks enabled?
- Pinmux correct on carrier board?
- Is the correct driver present and enabled in Zephyr?
- Is the IMU powered and visible on the I2C bus?
If you want to share specific dts, prj.conf, or more log output, I can further help spot possible configuration issues. If you continue to see “device not ready”, a useful debug step is to write a minimal I2C bus scan on the M7 to confirm the hardware connection to the IMU is operational.
Best regards,
Toradex AI Assistant.
https://community.toradex.com
https://github.com/toradex
Hello @yanisakk !
Yes, the I2C3 is exposed to the Cortex-M, they are labeled as I2C_4_CSI_SDA/SCL in the Verdin specification, but map to the SoC’s I2C3_SDA/SCL pins; They are not enabled by default as they are reserved to the HDMI for the board. This page contains an example that should be helpful in your use case.
And to answer your questions:
- I2C3 is exposed but not enabled but default as mentioned above, hopefully the guide linked will be helpful to you.
- We do not actively test and validate Zephyr OS images with our boards but there are no known impediments or restrictions that could be a problem in your case.
- While not for Zephyr specifically, the example I linked should be helpful for that.
- Same as above.
- As for guidance:
- Check if the drivers for the ST LSM6DSR IMU are compatible with the LSM6DSL;
- Check if changing the whoami register change is not breaking the sample code from zephyr;
- Check if you are using the right pinctrl node for pinctrl_i2c3 (Should look like the snippet below)
pinmux_i2c3: pinmux_i2c3 {
pinctrl-single,pins = <
MX8MP_IOMUXC_I2C3_SCL__I2C3_SCL 0x400001c3
MX8MP_IOMUXC_I2C3_SDA__I2C3_SDA 0x400001c3
>;
};
- Check if drivers are enabled on the appropriate .conf file
- Check the AI answer above too, it has some valuable insights that may prove helpful in your case.
Hopefully this helps, and if not, feel free to reply here for further guidance!