Skip to main content
Visitor II
April 24, 2019
Solved

MotionFX Library ARM Cortex-M4F Hardware Floating Point

  • April 24, 2019
  • 2 replies
  • 1269 views

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?

    This topic has been closed for replies.
    Best answer by Ozone

    > 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.

    2 replies

    OzoneAnswer
    Explorer
    April 24, 2019

    > 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.

    Daniel LAuthor
    Visitor II
    April 24, 2019

    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.

    ST Employee
    April 24, 2019

    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

    Daniel LAuthor
    Visitor II
    April 24, 2019

    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!