Skip to main content
Visitor II
October 27, 2020
Question

Linux Driver support for LSM6DSM module.

  • October 27, 2020
  • 2 replies
  • 5291 views

Hi Team,

I am working on LSM6DSM sensor bringup in linux kernel-4.9. I am using the following imu sensor driver sources (https://github.com/STMicroelectronics/STMems_Linux_IIO_drivers/tree/linux-4.9.y-gh/drivers/iio/imu/st_lsm6dsm). The driver is loading and the sensor is getting registered. The sysfs prints some random accelerometer and gyroscope values and When I probed the Interrupt pin I didn't get any interrupt.

Is the above driver is enough to add support for accelerometer and gyroscope. ?

Could you please help me to solve this issue ?

Regards,

Ajith.

    This topic has been closed for replies.

    2 replies

    ST Employee
    October 28, 2020

    Hi @AKuma.12esh​ ,

    Based on the linux drivers, did you configured all the device register to correctly get the data and the interrupt events?

    I mean SPI/I2C, ODR, operating mode, FIFO mode (if any), as for example depicted in the app note AN4987?

    1. Write CTRL1_XL = 60h // Acc = 416 Hz (High-Performance mode)
    2. Write INT1_CTRL = 01h // Acc data-ready interrupt on INT1

    And are you referring to a FIFO or to a mechanical event generated interrupt?

    -Eleon

    AKuma.20Author
    Visitor II
    October 30, 2020

    Hi @Eleon BORLINI​ ​ 

    Thanks for your response,

    I am referring to a mechanical event generated interrupt and my design uses I2C intereface, operating mode is accelerometer and gyroscope sensors active with independent ODR.

    Till now I didn't modify the driver. As per my understanding the following driver(https://github.com/STMicroelectronics/STMems_Linux_IIO_drivers/tree/linux-4.9.y-gh/drivers/iio/imu/st_lsm6dsm) provides basic support for the sensor module and I need to modify the register values in the driver based on the application. Please correct me if I am wrong.

    Regards,

    Ajith.

    AKuma.20Author
    Visitor II
    October 28, 2020

    Hi @Eleon BORLINI (ST Employee)​ 

    Thanks for your response,

    My design uses I2C intereface, operating mode is accelerometer and gyroscope sensors active with independent ODR and I want to implement interrupt mechanism to get new values.

    Till now I didn't modify the driver. As per my understanding the following driver (https://github.com/STMicroelectronics/STMems_Linux_IIO_drivers/tree/linux-4.9.y-gh/drivers/iio/imu/st_lsm6dsm) provides basic support for the sensor module and I need to modify the register values in the driver based on the application. Please correct me if I am wrong.

    Regards,

    Ajith.

    ST Employee
    October 30, 2020

    Hi Ajith @AKuma.12esh​ ,

    yes the drivers have not to be modified, but you have to configure the register for the data acquisition.

    You can check this article if it can be of some support for the Linux project implementation.

    -Eleon

    AKuma.20Author
    Visitor II
    November 3, 2020

    Hi @Eleon BORLINI (ST Employee)​ 

    Thanks for your response,

    I understood the application of interrupt pin (INT1) and If I write INT1_CTRL = 01h I am getting the interrupt pin going high.

    I am facing another issue, The accelerometer updates the values in a particular time intervals. If I move the board the accelerometer doesn't update the new values immediately after some time interval only it updates the values. And Even If don't move the board also I am getting new values after that time period.

    In which mode accelerometer updates the new values only if it gets movement ?

    Can you share the procedure/example for the mechanical event generated interrupt mode ?

    Regards,

    Ajith.