cancel
Showing results for 
Search instead for 
Did you mean: 

gnu math library about stm32f4

ctc.ctc
Associate II
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
1 REPLY 1
frankmeyer9
Associate II
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.