Skip to main content
ctc.ctc
Associate II
April 19, 2013
Question

gnu math library about stm32f4

  • April 19, 2013
  • 1 reply
  • 732 views
Posted on April 19, 2013 at 05:54

I want to use stm32f4 to control my accelerometer. And I need to use the acceleration value to calculate the rotation degree. So I need sqrt() and acos() function from math.h . I used gnu tool with st-link to finish my work before. But this time, I can't find math.h from stm32f4-firmware libary. I try to implement the sqrt(), acos() function by myself. But I think there's too much deviation from my function. How can I do to find the standard math.h to use in stm32f4? Thanks

#stm32f4-gnu-math
This topic has been closed for replies.

1 reply

frankmeyer9
Associate III
April 19, 2013
Posted on April 19, 2013 at 08:30

As the stm32f4 supports only float naturally, it is advisable to use sqrtf() and acosf() instead.

And yes, the math.h header and the libm.a library is not part of the peripheral library from ST. It is assumed to come with your toolchain.

In this course, you might need to deal with the ''float-abi'' issue, if you want to use the FPU.