Skip to main content
This topic has been closed for replies.

6 replies

S.Ma
Principal
June 3, 2019

Any telepath or mind melding Vulcan on this forum?

SBybe
SBybeAuthor
Associate II
June 3, 2019

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!

SBybe
SBybeAuthor
Associate II
June 3, 2019

Excuse me! The browser for some reason did not insert the text.

S.Ma
Principal
June 3, 2019

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.

turboscrew
Senior III
June 5, 2019

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.

Ozone
Principal
June 5, 2019

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".