2019-05-13 11:38 AM
2019-05-13 03:06 PM
Yes, so you're linking a limited capability library not supporting floating point printf/scanf functionality. Build with the proper library/settings. Similar issues with other GNU/GCC / TrueStudio based tools, search the forum, covered a shed load of times.
Or, just use some professional tools like Keil or IAR where things predominantly just work properly without having to read the documentation.
2019-05-13 11:30 PM
You can give a link to the forum on this topic?
2019-05-14 01:24 AM
Not the GP, try to search the web for "_printf_float". Here's a couple of links.
Your toolchain uses a free "Standard C" library called "newlib". More precisely, it uses the subset of the library called "newlib-nano" which is designed for memory/flash-constrained devices. If you read its documentation [1, 2] (yes, it's ok for professionals to read the documentation of the tools/libraries they use) you can find this:
Floating-point support is split out of the formatted I/O code into
weak functions which are not linked by default. Programs that need
floating-point I/O support must explicitly request linking of one or
both of the floating-point functions: _printf_float or _scanf_float.
This can be done at link time using the -u option which can be passed
to either gcc or ld. The -u option forces the link to resolve those
function references. Floating-point format specifiers are recognized
by default, but if the floating-point functions are not explicitly
linked in, this may result in undefined behavior for programs that
need floating-point I/O support.