Hardware floating point on STM32F4

Chris Johns chrisj at rtems.org
Sat Feb 22 23:03:13 UTC 2014

On 22/02/2014 10:32 am, Andrei Chichak wrote:
> Hello gurus,
> Something in Eclipse lead me to believe that I’m using soft float on my STM32F407 on my ST discovery board.
>    #if (__FPU_PRESENT == 1) && (__FPU_USED == 1)
> indicated that __FPU_USED was 0, and digging further lead me to the flag __SOFTFP__ is set. Hmmmm.
> Putting in some cheesy float code showed that I was calling a bunch of aeabi float library code instead of chucking in the hardware floating point commands. I have defined __FPU_PRESENT=1, but I think I may need a differently compiled compiler.
> The tools are running on my Mac and I put the whole thing together with Source Builder with the 4.11/rtems-arm.bset from Chris Johns about October 2013.

Nice to hear.

> Question: How do I go about getting the C compiler to generate hardware floating point instructions? Load a different compiler (how), or just throw another compiler flag?

A google for "gcc flags cortex m4 fpu" gave me this link ...


Maybe give these a try. You may need to update the BSP flags and rebuild 
RTEMS as the ABI may change from soft to hard floating point.

I suggest you check the generated code to make sure the instructions are 
using the FPU and then run the paranoia test in the samples directory of 
the testsuite.


More information about the users mailing list