2020-01-02 09:41 AM
I am interested in utilizing vetted STMicro LSM9DS1 software calibration tools and other STMicro "Middleware". I had assumed STMicro would support their own chip in order to encourage sales. But, the STMicro's LSM9DS1 chip is not supported in X-CUBE-MEMS1 according to the release notes found here (LSM9DS1 is not to be found anywhere in this document):
file:///C:/Users/ricks/proj/st/x_cube_mems1/en.x-cube-mems1/STM32CubeExpansion_MEMS1_V7.0.0/Release_Notes.html
2020-01-02 01:50 PM
There is a driver included here: https://github.com/STMicroelectronics/STMems_Standard_C_drivers
2020-01-03 08:12 AM
Thank you @KnarfB for your response. I looked through the sub directory "lsm9ds1_STdC" of the STMems_Standard_C_drivers you pointed to which contains the driver code for the STMicro LSM9DS1 chip. I see code to access the LSM9DS1. but I don't see any "Middle Ware" code. Such as code to implement electronic compass tilt compensation. Code which I believe exists in STmicro's X-CUBE-MEMS1 package. But X-CUBE-MEMS1 does not appear to support STMicro's own LSM9DS1 chip. Specifically, I'm looking for LSM9DS1 chip support similar to what is found in the STM32_MotionEC_Library found here: en.x-cube-mems1\STM32CubeExpansion_MEMS1_V7.0.0\Middlewares\ST\STM32_MotionEC_Library when expanding the X-CUBE-MEMS1 zip file from STMicro.
2020-01-06 12:58 AM
The Middleware libraries are sensor agnostic so basically you can use them with any sensor.
The LSM9DS1 is not supported in X-CUBE-MEMS1 package but you can write your own firmware using the LSM9DS1 driver and the MotionEC library.
2020-01-06 05:08 AM
This is good news. I am already communicating with the LSM9DS1 using the drivers STMicro maintains on Github.com. Above that, I wrote code to derive the compass heading. But only for the simple case where I am using the X & Y magnetometer (where Z is always pointed down toward the earth). So, you are saying I can give that data to X-CUBE-MEMS1 (the MC for compass calibration & EC for compass heading) and in return get back the heading from a calibrated compass! That would be great!
Assuming these are the two correct drivers to use for calibrating a compass and calculating the compass heading - are there any examples where they are used? I was looking through the examples packaged with X-CUBE-MEMS1 and did not come across a compass heading example.
-thanks
2020-01-06 05:18 AM
Correct, you should use MotionMC (Magnetometer calibration library) and MotionEC (eCompass) for device orientation. The heading can be then calculated from the outputs from MotionEC library. Please check ECompass application in X-CUBE-MEMS1 package, you can use it as example or reference for you project.