cancel
Showing results for 
Search instead for 
Did you mean: 

MotionFX Library ARM Cortex-M4F Hardware Floating Point

Daniel L
Associate III

Hi,

I am attempting to port the MotionFX Library example to another processor. The project I am using as a reference is the DataLogFusion project for the STM32L476RG-Nucleo in the X-CUBE-MEMS1 V6.0.1. I am trying to compile it on another ARM Cortex M4F Processor and am getting the following error:

Output/Release/Exe/project.elf uses VFP register arguments, ./STM32_MotionFX_Library/Lib/MotionFX_CM4F_wc32_ot.a(motion_fx.o) does not

It seems as the MotionFX Library has been compiled using software floating points and does not utilise the FPU. Is this so it can also be used on the M4? Are there any available pre-compiled versions of the library using the FPU on the M4F?

1 ACCEPTED SOLUTION

Accepted Solutions
Ozone
Lead

> Output/Release/Exe/project.elf uses VFP register arguments, ./STM32_MotionFX_Library/Lib/MotionFX_CM4F_wc32_ot.a(motion_fx.o) does not

> It seems as the MotionFX Library has been compiled using software floating points and does not utilise the FPU.

Not quite correct.

The error message means the argument passing is different.

Your project seems to pass them in FPU registers (-mfloat-abi=hard), but the library expects them in core registers (-mfloat-abi=softfp).

Only "soft" would use slow floating point emulation code.

View solution in original post

4 REPLIES 4
Ozone
Lead

> Output/Release/Exe/project.elf uses VFP register arguments, ./STM32_MotionFX_Library/Lib/MotionFX_CM4F_wc32_ot.a(motion_fx.o) does not

> It seems as the MotionFX Library has been compiled using software floating points and does not utilise the FPU.

Not quite correct.

The error message means the argument passing is different.

Your project seems to pass them in FPU registers (-mfloat-abi=hard), but the library expects them in core registers (-mfloat-abi=softfp).

Only "soft" would use slow floating point emulation code.

Miroslav BATEK
ST Employee

Hello @Daniel L​ 

The library is compiled with softfp option, so it uses the FPU but it doesn't use specific FPU registers in function calls.

We use this softfp option because we have some compatibility issue for different IDEs if we use hard option.

If you really need a library compiled with hard option please send a ticket through OLS, we should be able to provide it.

Best regards

Miroslav

Thanks for your reply Ozone.

After a bit more reading, I finally understand your answer. You were correct I was using -mfloat-abi=hard. I did not realise there were three compile options (-mfloat-abi=soft/softfp/hard), and that softfp can still utilise hardware floating point instructions. I found this article very helpful in my understanding.

Hi Microslav,

It makes sense that softfp would be used instead of hard for compatibility. I might go ahead and request a hard compiled library. Thanks!