Lsmdsr with dhalia eval board and verdin imx8mplus module

Hello,
I have an dhalia eval board with an imx8mplus module and i bulding my distro with yocto.
I trying to connect an imu with the 40 pin gpios.
i see the imu with i2c detect and i can comunicate with i2c set.
But i would like to mount the kernel driver but i always have this logs on the kernel :

[    1.145561] i2c_dev: i2c /dev entries driver
[    1.456324] i2c i2c-0: IMX I2C adapter registered
[    1.523999] st_lsm6dsx_i2c 1-006b: failed to read whoami register
[    1.530347] i2c i2c-1: IMX I2C adapter registered
[    1.536081] i2c i2c-2: IMX I2C adapter registered

but when i lunch this command :
echo lsm6dsr 0x6b > /sys/bus/i2c/devices/i2c-1/new_device
i see the folowing logs

[  147.670266] st_lsm6dsx_i2c 1-006b: supply vdd not found, using dummy regulator
[  147.677799] st_lsm6dsx_i2c 1-006b: supply vddio not found, using dummy regulator
[  147.743533] st_lsm6dsx_i2c 1-006b: failed to read whoami register
[  147.750010] i2c i2c-1: new_device: Instantiated device lsm6dsr at 0x6b

but i can see the driver prams under /sys/bus/iio/devices/iio:device
The patch i did in the yocto is :

diff --git a/arch/arm64/boot/dts/freescale/imx8mp-verdin.dtsi b/arch/arm64/boot/dts/freescale/imx8mp-verdin.dtsi
index 2b0e520a7838..08d1a81cb20a 100644
--- a/arch/arm64/boot/dts/freescale/imx8mp-verdin.dtsi
+++ b/arch/arm64/boot/dts/freescale/imx8mp-verdin.dtsi
@@ -113,6 +113,7 @@ reg_1p8v: regulator-1p8v {
 		regulator-max-microvolt = <1800000>;
 		regulator-min-microvolt = <1800000>;
 		regulator-name = "+V1.8_SW";
+    	regulator-boot-on;
 	};
 
 	reg_3p3v: regulator-3p3v {
@@ -698,6 +699,14 @@ eeprom@50 {
 		pagesize = <16>;
 		reg = <0x50>;
 	};
+	lsm6dsr@6b {
+        compatible = "st,lsm6dsr";
+        reg = <0x6b>;
+		label = "IMU";
+		vdd = <&reg_1p8v>;
+       vddio = <&reg_1p8v>;
+		status = "okay";
+    };
 };
 
 /* Verdin I2C_2_DSI */

and i check that the drivers are instancied:
CONFIG_IIO=y
CONFIG_IIO_BUFFER=y
CONFIG_IIO_ST_LSM6DSX=y
CONFIG_IIO_ST_LSM6DSX_I2C=y
CONFIG_IIO_ST_LSM6DSX_SPI=y
CONFIG_IIO_ST_LSM6DSX_I3C=y
CONFIG_IIO_ST_SENSORS_I2C=m
CONFIG_IIO_ST_SENSORS_SPI=m
CONFIG_IIO_ST_SENSORS_CORE=m
CONFIG_IIO_ST_LSM6DSX=y

Do you have an idea of what i’m missing ?

Yannick

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 Yannick,

Thank you for reaching out with your question. It sounds like you’re encountering some challenges with integrating your IMU sensor on the Dahlia evaluation board with the Verdin iMX8M Plus module. Let’s go through some steps to help resolve the issues you’re facing with the kernel driver.

  1. Dummy Regulator Messages: These messages indicate that the kernel is using a placeholder regulator because it cannot find the specified power supply. Please ensure that the reg_1p8v regulator is correctly defined and enabled in your device tree. It should be the intended power source for your IMU sensor.

  2. Device Tree Configuration: Double-check your device tree modifications. Make sure that the vdd and vddio properties in your IMU node (lsm6dsr@6b) correctly reference the reg_1p8v regulator. Also, verify that this regulator is enabled and available at boot time.

  3. I2C Bus and Address: Confirm that the I2C bus and address are correctly specified. The logs show attempts on i2c-1 and i2c-0. Ensure that your IMU is connected to the correct I2C bus and that the address 0x6b is accurate.

  4. WHO_AM_I Register Read Failure: This failure might be due to incorrect I2C communication or a misconfigured device tree. You can use i2c-tools to manually read the WHO_AM_I register to verify communication. If the manual read fails, check the physical connections and ensure the IMU is powered correctly.

  5. Kernel Driver Configuration: Ensure that the necessary kernel configurations for the LSM6DSR driver are enabled, as you have listed. Double-check that these configurations are included in your Yocto build.

By addressing these areas, you should be able to resolve the issues with the dummy regulators and the WHO_AM_I register read failure. If you continue to experience problems, reviewing the hardware setup and connections might be beneficial to ensure everything is correctly configured and powered.

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

Best regards,
Toradex AI Assistant

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

i.MX7D Device Tree Customization for I2C.