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.
The linker command shown in the console window:
arm-none-eabi-g++ -o 4040D_STM32Cube.elf Drivers\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal.o
Src\values_log.o startup_stm32l451xx.o -mcpu=cortex-m4 -TF:\work\FlameDetectors\4040D_STM32Cube\stm32l4_flash.ld --specs=nosys.specs -Wl,-Map=4040D_STM32Cube.map -Wl,--gc-sections -static --specs=nano.specs -mfpu=fpv4-sp-d16 -mfloat-abi=hard -mthumb -u _printf_float -u _scanf_float -Wl,--start-group -lc -lm -lstdc++ -lsupc++ -Wl,--end-group
In the linker command I see that -u_printf_float is defined - and still I get the errors that printf doesn't support float!!!
You are using "newlib-nano" standard C library and it doesn't support float printf anyway. So even if you fix your compilation / link option issue, it will not work (for example a printf of a float will return 0.0000).
if I remember correctly (not sure though), "newlib" should support float printf.
As you've seen yourself - these errors are mentioned, but the project can be debugged.
I haven't been able to see the printfs in the SWV console - that's another thread that I opened in the forum...