Skip to main content
Mike Rosing
Associate III
November 27, 2017
Question

Are there any single precision fpu libraries for stm32f72x?

  • November 27, 2017
  • 2 replies
  • 1234 views
Posted on November 27, 2017 at 03:35

Howdy,

I just got the NUCLEO-F722ZE board and have played with it enough to know it will be useful for my home project.  I used the

http://www.st.com/content/st_com/en/products/embedded-software/mcus-embedded-software/stm32-embedded-software/stm32cube-embedded-software-expansion/x-cube-fpudemo.html

and looked at the disassembly to confirm it can compile floating point with the tool suite I have (TrueStudio).  I have looked over a lot of places but have not found any math libraries for this device - but the chances are really high I don't know where to look.  Are there any single precision libraries which implement trig and exp functions which can link with this processor? 

If not, I'll just write one and put it up here.  I'm just trying to be lazy! 

Thanks,

Mike

#stm32f72 #math-library #fpu
This topic has been closed for replies.

2 replies

David SIORPAES
ST Employee
November 27, 2017
Posted on November 27, 2017 at 10:15

Hello,

you can have a look to ARM's 

http://www.keil.com/pack/doc/CMSIS/DSP/html/index.html

. It includes integer and floating point unit optimized operations for DSP applications.
Mike Rosing
Associate III
November 27, 2017
Posted on November 27, 2017 at 15:23

 ,

 ,

Thanks! , That definitely has way more than I need. , The only thing missing is exp(x) which is not used in DSP, so I can save a lot of time with this library. , The functions

http://www.keil.com/pack/doc/CMSIS/DSP/html/group__sin.html ♯ gae164899c4a3fc0e946dc5d55555fe541

(), ,

http://www.keil.com/pack/doc/CMSIS/DSP/html/group__cos.html ♯ gace15287f9c64b9b4084d1c797d4c49d8

() and ,

http://www.keil.com/pack/doc/CMSIS/DSP/html/group__SQRT.html ♯ ga697d82c2747a3302cf44e7c9583da2e8

() are what I'm looking for.
Tesla DeLorean
Guru
November 27, 2017
Posted on November 27, 2017 at 17:14

As I recall GNU/GCC has intrinsics for sinf (__builtin_sinf), powf, expf, etc, so it is apt to in-line rather than pull from a library.

The FPU is relatively lackluster when it comes to transcendental functions. ie it is not an 80x87

The FPU also doesn't hold values with higher intermediate precision, at some point if you understand your required math well you'd be better hand coding something, and keeping things in double precision internally until you export the result. This would require the CM7 built as intended with the FPU-D option.

Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..
Mike Rosing
Associate III
November 27, 2017
Posted on November 27, 2017 at 18:11

This particular processor does not have double precision and my application does not need it.  But if I link with -lm, I don't think there is a math.lib with my compiler.   I'm so used to tiny processors not having that automatically, I will see what the tool suite does when I make that request.  If it's builtin then the reason I couldn't find it is because I was looking too far away!