CubeIDE and float
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2019-06-03 12:20 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2019-06-03 12:22 PM
Any telepath or mind melding Vulcan on this forum?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2019-06-03 12:25 PM
Hello! There are stm32f103 and CubeIDE. There is a need to use real numbers in calculations - float. How to configure CubeIDE to work with them? Now variables have zero values!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2019-06-03 12:27 PM
Excuse me! The browser for some reason did not insert the text.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2019-06-03 1:27 PM
Using float or double is compiler related, not IDE. It should work as long as you declare float variables.
Just try to avoid using float inside interrupt functions (callbacks).
I use float only when necessary, such as converting accelerometer x,y,z into roll, pitch and gravity vectors.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2019-06-04 9:48 PM
BTW, you are using C libraries?
Without C runtime, the global variables with initializers are not initialized. Not even integers.
And, of course, you need the float math library functions.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2019-06-04 10:27 PM
I suppose you would need to define that when running the "new project" setup, when the IDE selects the appropriate libraries.
The F103 has no FPU, so floating point implicitly means emulation ("soft").
Besides of mentioned runtime issues, be aware of the very limited precision of "float".
