November 2016
DocID030074 Rev 1
1/17
www.st.com
UM2146
User manual
Getting started with osxMotionMC magnetometer calibration
library for X-CUBE-MEMS1 expansion for STM32Cube
Introduction
The osxMotionMC add-on software package for X-CUBE-MEMS1 software runs on the STM32 and
includes drivers that recognize the inertial sensors. It provides real-time magnetometer calibration using
hard iron (HI) and scale factor (SF) coefficients to correct magnetometer data.
The osxMotionMC magnetometer calibration algorithm is provided in static library format and is
designed to be used in STM32 microcontrollers based on the ARM Cortex-M3 or ARM Cortex-M4
architecture.
It is built on top of the STM32Cube software technology for portability across different STM32
microcontrollers.
The software comes with sample implementations running on the X-NUCLEO-IKS01A1 (with optional
STEVAL-MKI160V1) or X-NUCLEO-IKS01A2 expansion board on a NUCLEO-F401RE or NUCLEO-
L476RG development board.
UM2146
2/17
DocID030074 Rev 1
Contents
1 osxMotionMC library add-on to X-CUBE-MEMS1 software
expansion for STM32Cube ...................................................................... 4
1.1 osxMotionMC overview ..................................................................... 4
1.2 osxMotionMC architecture ................................................................ 4
1.3 osxMotionMC folder structure ........................................................... 5
1.4 osxMotionMC library ......................................................................... 6
1.4.1 osxMotionMC library description ........................................................ 6
1.4.2 osxMotionMC APIs ............................................................................. 6
1.4.3 Storing and loading calibration parameters ........................................ 7
1.4.4 API flow chart ..................................................................................... 8
1.4.5 Magnetometer calibration demo code ................................................ 8
1.4.6 Calibration process ............................................................................. 9
2 Sample application ........................................................................ 11
2.1 Unicleo-GUI utility ........................................................................... 11
3 References ..................................................................................... 15
4 Revision history ............................................................................ 16