8 years, 8 months ago.

FPU soft or hard?

Hi, I'm using CooCox IDE to build some projects. I found that in the configuration part, FPU can be set to FPU hard, the default situation is FPU soft. I thought hard will be better so I changed to FPU hard, but the compiler went wrong.

So I wonder if the mbed SDK didn't support FPU hard mode? Or there needs some modification?

Has any one met the same problem?

My board is Nucleo stm32f411ret6. Thanks~

/media/uploads/Setsuna/qq--20150911150537.jpg /media/uploads/Setsuna/qq--20150911150556.jpg

Above is some screenshots of this error. Maybe this is a stupid question to you,but I'm new to ARM, everything seemed to be unfimiliar to me.

1 Answer

8 years, 8 months ago.

The mbed libraries are built with FPU soft for compatibility and maintainability. Object files built with FPU hard are not ABI compatible with ones build with FPU soft.

Accepted Answer

Is there a way of compiling the libraries for FPU hard? I'm doing something relatively maths intensive and it would be handy to off-load the calcs to the FPU on the Nucleo F411. I'm a mechanical engineer rather than a heavy duty coder, so answers of one syllable would be very handy, preferably with very colourful pictures. Basically treat me as a three year old.

posted by Dave Turner 11 Sep 2015

Sam, Thank you for your answer. My concern is just Dave's ,too. I want to build something(may be a fly control system) that requires complex maths calculation, but I can't spend too much time on learning traditional way of developing STM32. So is there a way to use FPU hard instead of present FPU soft method? Or will it be possible that, in future updates, mbed lib will support FPU hard? Thank you.

posted by Jerry Chan 11 Sep 2015

So building it with mbed-src should then work for him?

Btw @ Jerry, FPU soft still uses the FPU, it is only something related to how it uses FPU registers.

Edit: Thats what I get for pressing submit directly, you get other comments between. So two parts to note for you guys: You can try exporting mbed-src and building from that instead of building from regular mbed, then you can rebuild the entire mbed lib.

Second one is that despite its name, the soft FPU is NOT a software fpu implementation. It gives extra overhead because it does not use (all) FPU registers, but the actual FPU should still be used afaik.

posted by Erik - 11 Sep 2015

@Erik Olieman, Thank you, your suggestions really helps.

posted by Jerry Chan 11 Sep 2015