cancel
Showing results for 
Search instead for 
Did you mean: 

Using X-CUBE-MEMS1 for lsm9ds1

Jumshed Akhtar
Associate II

Hi, I want to use -CUBE-MEMS1 for lsm9ds1. By default the applications code uses LSM303AGR . Could any one give me some hints what changes I need to do for porting ECompas application for lsm9ds1. I have already ported the driver accelerometer, gyro and magnetometer for lsm9ds1. I am asking for application and mathematics difference as done in Ecompas application code.

Axis orientation is different for these two chips.. How to handle that difference in source code.

Here is link for for X-CUBE-MEMS1 https://www.st.com/content/st_com/en/products/embedded-software/mcu-mpu-embedded-software/stm32-embedded-software/stm32cube-expansion-packages/x-cube-mems1.html

Application is inside the package;

STM32CubeExpansion_MEMS1_V6.0.1\Projects\STM32L476RG-Nucleo\Applications\IKS01A3\ECompass

Thanks

2 REPLIES 2
Eleon BORLINI
ST Employee

Hi, only the sign of the x axis of the magnetometer is reversed between LSM9DS1 and LSM303AGR. If you already managed to get the data from the sensors in your project, you could then use the same eCompass library of the by simply changing the sign of the x data of the magnetometer and check the algorithm is working properly. Regards

Rstua.1
Senior

@Eleon BORLINI​ , could you elaborate how to adapt the X-CUBE-MEMS1 library for use with the STMicro LSM9DS1 chip? A quick look and it appears the code is tightly bound to "other" hardware chips. I too am currently reading data from the LSM9DS1 and believe I only need the Middle Ware features such as compensating for tilt when using the magnetometer.

-thanks