Skip to main content
Visitor II
March 19, 2021
Solved

X-CUBE-MEMES for LSM9DS1

  • March 19, 2021
  • 2 replies
  • 999 views

Hi,

I am trying to calibrate my IMU on a custom board using X-CUBE-MEMS package. However there is no support for the LSM9DS1 part. I've seen on the community that the alternative for the Accelerometer+Gyroscope is the LSM303AGR library. However, this only offers support for the I2C bus. In my custom board, the IMU is connected to the uC through a SPI bus.

Is there any alternative?

Also, which library should I use to calibrate the magnetometer?

Thanks in advance,

Pedro Machado

    This topic has been closed for replies.
    Best answer by Eleon BORLINI

    Hi Pedro @Community member​ ,

    the X-CUBE-MEMS1 firmware function pack is -in principle- independent from the platform (you don't need, for example, the X-NUCLEO-IKS01A3 board to use them.

    The libraries in this package can be fed by any data (provided that it is accelerometer, gyroscope or magnetometer data, and that you are running them on an STM32 MCU) and the algorithm processes the input giving the required output.

    For example, in the case of magnetometer calibration, you can just acquire the LSM9DS1 data and feed with them the MotionMC magnetometer calibration library, that provides real-time magnetometer calibration using hard iron (HI) and scale factor coefficients to correct magnetometer data.

    -Eleon

    2 replies

    ST Employee
    March 19, 2021

    Hi Pedro @Community member​ ,

    the X-CUBE-MEMS1 firmware function pack is -in principle- independent from the platform (you don't need, for example, the X-NUCLEO-IKS01A3 board to use them.

    The libraries in this package can be fed by any data (provided that it is accelerometer, gyroscope or magnetometer data, and that you are running them on an STM32 MCU) and the algorithm processes the input giving the required output.

    For example, in the case of magnetometer calibration, you can just acquire the LSM9DS1 data and feed with them the MotionMC magnetometer calibration library, that provides real-time magnetometer calibration using hard iron (HI) and scale factor coefficients to correct magnetometer data.

    -Eleon

    Super User
    March 19, 2021

    I didn't know that X-CUBE had become a meme ?!

    :beaming_face_with_smiling_eyes: :face_with_tears_of_joy: :grinning_face_with_sweat:

    ST Employee
    April 7, 2021

    :grinning_face_with_sweat: