I am having an issue with floats and snprintf. I created a small demo program using CubeMX 5.2 and put it on bitbucket: https://bitbucket.org/arminoonk/printf-float-issue/src/master/
I have added “-u _printf_float” to the GCC Linker flags. Complete linker flags are: “-specs=nosys.specs -specs=nano.specs -u _printf_float”
In the default task I have added a small blinking led. In a separate task I have the following code:
snprintf(temp, 33, “%f”, 6.66)
When snprintf is run a hard fault handler occurs. The stack size for the snprintf task is 2048 words which should be enough.
I have created code using snprintf before using cubemx. This worked beautifully but now suddenly it stopped.
Is there a known issue with the newer releases of cubeMX/system workbench? Is there a work around?