cancel
Showing results for 
Search instead for 
Did you mean: 

Integration of the LSM6DSM imu sensor with the Android Source code 11

pritamsrisahoo
Associate II

Hii, 

I am using the LSM6DSM imu sensor module . To integrate the driver i followed the link:-https://github.com/STMicroelectronics/st-mems-android-linux-drivers-iio
my device tree modifications looks like this:

&i2c3 {

    clock-frequency = <400000>;

    pinctrl-names = "default", "gpio";

    pinctrl-0 = <&pinctrl_i2c3>;

    //pinctrl-1 = <&pinctrl_i2c3_gpio>;

    sda-gpios = <&gpio5 19 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;

    scl-gpios = <&gpio5 18 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;

    status = "okay";

 

    #address-cells = <0x1>;

    #size-cells = <0x0>;

 

    lsm6dsm-imu@6a {

        compatible = "st,lsm6dsm";

        reg = <0x6a>;

        //spi-max-frequency = <1000000>;

        interrupt-parent = <&gpio5>;

        interrupts = <5 IRQ_TYPE_LEVEL_HIGH>;

        //st,drdy-int-pin = <1>;

        //st,module_id = <5>;

        status = "okay";

    };

};

and my .config file looks like:

 

CONFIG_IIO_STM=y

CONFIG_ST_LSM6DSM_IIO=y

CONFIG_ST_LSM6DSM_I2C_IIO=y

CONFIG_ST_LSM6DSM_SPI_IIO=y

CONFIG_IIO_ST_LSM6DSM_EN_BASIC_FEATURES=y

CONFIG_ST_LSM6DSM_IIO_LIMIT_FIFO=0

CONFIG_ST_LSM6DSM_STEP_COUNTER_ON_DURING_SUSPEND=y

CONFIG_ST_LSM6DSM_IIO_MASTER_SUPPORT=y

CONFIG_ST_LSM6DSM_ENABLE_INTERNAL_PULLUP=y

CONFIG_ST_LSM6DSM_IIO_EXT0_LIS2MDL=y

CONFIG_ST_LSM6DSM_XL_DATA_INJECTION=y

 i have integrated the driver in my kernel source 5.4 and successfully loaded the driver but i am getting the same sensor coordinate values(x,y and z coordinates ) even if i rotate the device also.But with the default driver in the kernel source i can verify that the values are changing continuously.What may be the reason for getting the same coordinates values??

Default driver link:-https://github.com/unifreq/linux-5.4.y/blob/main/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_i2c.c

Is there anything i am doing wrong?
Attaching the log file please verify.
Please provide me any solution into the matter.

Thanks & Regards
Pritam

0 REPLIES 0