2020-02-06 01:11 AM
Not a question but a statement. I've just upgraded a very large project from HAL V1.3 to V 1.6. The code uses sprintf in a couple of places. This worked fine under 1.3 using newlib_nano. Under 1.6 the same statement gives a NULL return. Swapping to newlib_standard fixes the issue. It appears that the version of newlib_nano distributed under 1.6 has changed and is no longer reliable, at least for floats.
Solved! Go to Solution.
2020-02-06 01:49 AM
Seems to be a CubeMX change - Just been through the project properties and the old version had "-u _printf_float" in Project -> Properties -> C/C++ Build -> Settings -> MCU Linker -> Miscellaneous.
The new version didn't. I'm pretty sure I didn't put it there
Anyway the solution is to put "-u _printf_float" in Project -> Properties -> C/C++ Build -> Settings -> MCU Linker -> Miscellaneous
2020-02-06 01:28 AM
newlib is not part of HAL, it's distributed with the toolchain.
2020-02-06 01:49 AM
Seems to be a CubeMX change - Just been through the project properties and the old version had "-u _printf_float" in Project -> Properties -> C/C++ Build -> Settings -> MCU Linker -> Miscellaneous.
The new version didn't. I'm pretty sure I didn't put it there
Anyway the solution is to put "-u _printf_float" in Project -> Properties -> C/C++ Build -> Settings -> MCU Linker -> Miscellaneous
2020-02-06 01:58 AM
newlib is not part of STMCubeMX either. There are no C/C++ build settings in CubeMX.
You mean STM32CubeIDE, don't you?
2020-02-06 02:05 AM
"You mean STM32CubeIDE, don't you?"
No, I use Attolic, but the project was created by CubeMX which sets the project properties THUMB2, FP, etc.
I now understand the newlib library was "provided" by the toolchain but it is CubeMX that sets the default properties when you create a project from scratch