How can i implement the math library in the STM32CubeIDE?
I use the STM32L011 and i want to implement the atan2(x,y) function.
But I can not get a working result....
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-07-10 5:02 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-07-10 5:50 AM
No need to implement, it already exists. Add #include <math.h> to your source code and add linker flag -lm That brings in the math lib for gcc.
For the curious: Sources are roughly here: https://sourceware.org/git/?p=newlib-cygwin.git;a=blob;f=newlib/libm/math/e_atan2.c
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-07-10 5:59 AM
Running floating point on my L011, but not using CubeIDE. ST has a free Keil License for their Cortex-M0(+) devices.
Make sure to enable all options/checkboxes to pull in the appropriate C run-time libraries, including floating point support.
The chips have relatively small Flash, so I'd imagine if you pull in a lot of the transcendental stuff things could get tight.
Up vote any posts that you find helpful, it shows what's working..
