Skip to main content
RMath.3
Associate
October 30, 2020
Question

How to read raw data from LSM6DSL?

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

This topic has been closed for replies.

3 replies

Eleon BORLINI
ST Employee
November 2, 2020

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
RMath.3Author
Associate
November 3, 2020

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

Eleon BORLINI
ST Employee
November 24, 2020

Hi @RMath.3​ ,

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

-Eleon