cancel
Showing results for 
Search instead for 
Did you mean: 

Hello, I use X-CUBE-MEMS1 in CubeIDE. I added MOTION_FX in my project (like my images) but when i call a function in MotionFx, i have error "undefined reference". Could you tell me how to fix it ? Thank you.

M623
Associate II
 
1 ACCEPTED SOLUTION

Accepted Solutions
KnarfB
Principal III
7 REPLIES 7
KnarfB
Principal III

If you're using a Cortex-Mo M0+ MCU, use the functions from  motion_fx_cm0p.h, e.g. MotionFX_CM0P_initialize();

see "Getting started with MotionFX sensor fusion library in X-CUBE-MEMS1 expansion for STM32Cube" usr manual.

M623
Associate II

I use STM32WB - CortexM4.

But i have the same problem with all the functions in motion_fx.h and motion_fx_cm0p.h.

My IDE can't find the reference to these functions

Cartu38 OpenDev
Lead II

Works for me if STM32CubeIDE 1.5.1 & MEMS pack 8.2.0.

Please note .a file is used (archive file <=> precompiled code) ... I guess function implementation is part of.

0693W000006Hp2aQAC.jpg 

KnarfB
Principal III

Exactly. The last (linker) step in the build console should link that library (-l). Exact name depends on MPU core.

arm-none-eabi-gcc -o "MotionFX.elf" @"objects.list"  -l:MotionFX_CM0P_wc32_ot.a ...

If not, check that the library is in project properties:

0693W000006HpNiQAK.png

M623
Associate II

Thank you,

I added Library Paths like you but it cannot find the MotionFX_CM4F_wc32_ot.a

I don't know how to link to .a file

KnarfB
Principal III

0693W000006HrQUQA0.png

M623
Associate II

Thank you for all support,

Finally it works for me 😁

For information, with Cortex M4 we need to config the Floating point to work with MotionFx. More information here :

https://community.st.com/s/question/0D50X0000AkPUqYSQW/motionfx-library-arm-cortexm4f-hardware-floating-point