cancel
Showing results for 
Search instead for 
Did you mean: 

How to read raw data from LSM6DSL?

RMath.3
Associate

LSM6DSL is connected to processor via i2c bus 

Following are the configuration made in dts and config file:

imu: st-lsm6dsl@6b {

        compatible = "st,lsm6dsl";

        reg = <0x6b>;

    };

config file

CONFIG_IIO_ST_LSM6DSX=y

CONFIG_IIO_ST_LSM6DSX_I2C=y

I am able to see device address (0x6B) at boot time but not able to read value from sys/bus/i2c/devices/2-006B/iio:device0 and iio:device1 on doing cat in_accel_x_raw

3 REPLIES 3
Eleon BORLINI
ST Employee

Hi @RMath.3​ ,

are you using the STMems_Linux_IIO_drivers for LSM6DSL you can find on Ghithub? (Well, they are for the LSM6DSM, but they are compatible too)

You have to write at least this instruction the to be able to read the dataout (p.22 of the AN5040 app note).

1. Write CTRL1_XL = 60h // Acc = 416 Hz (High-Performance mode)

-Eleon

RMath.3
Associate

Hi @Eleon BORLINI​ 

I am using a driver similar to following one, with Linux 5.4

https://github.com/torvalds/linux/tree/master/drivers/iio/imu/st_lsm6dsx

-Rohan M

Hi @RMath.3​ ,

did you solve your issue or did you try with posting your question on Github?

-Eleon