2019-06-27 01:03 AM
When I compile, I get the following error:
The float formatting support (-u_printf_float)is not enabled from linker flags
I can't find Linker flags/Options/Settings for C - just for MCU G++ Linker. When I chose the option, it still didn't remove the error. It compiles, though and can be run.
Solved! Go to Solution.
2019-07-17 02:20 AM
Just to clarify:
1) I made a mistake, it seems like newlib-nano does support float printf
2) the problem comes from the stack initialisation bug
This issue is discussed many times on different forums on the web but it's a bit confusing.
2019-07-17 03:11 AM
I suggest to using this library instead of this linker option.
https://github.com/mpaland/printf
Try to use built-in pritf with RTOS, SWO tracing & floating point support. Good luck :D.
2019-07-17 03:22 AM
2019-07-17 03:23 AM
The Problems tab is very convenient to see all bugs concentrated into a nice neat list...
2019-07-17 03:25 AM
Are there any other directions for using this library? What settings do i need to set in the IDE?
2019-07-17 04:51 AM
If it is reliable I agree. But apparently it does not correspond to errors or warnings found by the build system.
2019-07-17 04:57 AM
If you are trying to print on SWV console I cannot help you since I was never able to make it work (on TrueStudio on STM32L4 few months ago I gave up, on STM32CubeIDE and STM32H7 there is a different issue for which I started a dedicated thread).
If you are trying to print in a UART console (via virtual com port or physical RS232), I think the only setup at IDE level is this "float printf" option, and apart from that implement __io_putchar or _write fucntion and configure UART, you can easily find how to do on the web.
2019-07-18 10:16 PM
This problem is fixed in STM32CubeIDE ver.1.0.2.
Workaround in older version is to add "-u _printf_float" to MCU GCC Linker -> Miscellaneous -> Other flags.
2019-07-21 01:05 AM
This worked.
thanks...
I'm going to update to the latest release...
2022-06-14 04:51 AM
Hello @MFend
are you able to fix it? Is it working for you now?