cancel
Showing results for 
Search instead for 
Did you mean: 

Motionfx library on any stm32?

suads
Associate III

Hello,

I have a nucleo and a expansion board and i use it to get raw data from accelerometer,magnetometer and gyroscope.

My question is How I use the motionfx library?

Can I get for example quaternions?

I can 't find any source code for motionfx!

6 REPLIES 6
Eleon BORLINI
ST Employee

Hi @suads​ , you can use the MotionFX library together with a standard NUCLEO board + IKS01A2 or A3 HW platforms. The library is included in the X-CUBE-MEMS1 function pack.

About the possibility to have the low level source code for this library, since this is not publicly available, please note that the release of STM proprietary libraries is subject to signature of a License User Agreement (LUA); please contact an STMicroelectronics sales office and representatives at this link for further information.

Regards

So I have a expansion board X-NUCLEO-IKS01A2 and nucleo stm32wb55. I found some examples in cubemx for different platforms (f401re,l073rz,l152re) but not stm32wb55. From the document UM2613 it says u can use stm32wb55 with the expansion board IKS01A3.

Can I use the motionfx libray with Cubemx generated code for stm32wb55 and IKS01A2?

Thanks!

Do you mean the P-NUCLEO-WB55 board, right? Being a quite new platform, the supported shields and libraries are currently under update. The arm core M0 an the STM32L0 family, for which there are available examples, so I think that it's only a matter of compiling the code for the proper STM32WB MCU, and you can ask it to the same link I shared before. Regards

suads
Associate III

I don't know who to contact? But I've made some progresses on my own if anyone need help feel free to contact me.

I have successfully ported it to stm32wb55 using the sensors lsm6dsl(acc/gyro), lsm303agr(acc/mag) to get raw data. I loaded the motionfx library, to get the quaternions and seems to work but having some problems with the orientation and calibration of the sensors.

If I turn it left it flips, if I move it up it rotates... Im using a python script to test the quaternions. I try to change the orientation by setting the knobs(ned,enu,seu,nwu) in motionfx library but with no success.

Is there a way to test quaternions?, or the raw data from acc/gyro/ and magnetometer?

Edit: Finally I ve got the correct rotation, but with one problem If I roatate it 360 degrees(to the left or right) It rotates more than it should, and than I m losing my starting position. How to avoid this?

suads
Associate III

Thanks! for the help I have succeeded, I have changed the output data rate of the magnetometer to 50Hz and the calibration of the magnetometer to 20ms for my last rotation probelm.

Hi @suads​ , thank you for sharing your findings progression for the benefit of the community �� Regards