Since sprintf wasn’t writting float variables for me, I found in several places that this feature has to be enabled through linker arguments. For example as it said in this link
Enabling by “-lc -u _printf_float” and “-lc -u _scanf_float”, I have sprintf working correctly with floats, while sscanf get stucked in some kind of infinite loop.
I tried to use newlib by removing “–specs=nano.specs” and sprintf works nice too. On the other hand, sscanf don’t fall in that infinite loop but I saw that string I passed as argument has been written in the proccess causing a corruption of the data.
If the string buffer is small enough it keeps writing garbage out, which is more catastrophic.
I’m using SDK_2.9.0_MIMX8QX5xxxFZ, Build Date: 2021-10-01. I think this is te latest.
But confused I tried again in the code in where I was having the issue. By default the examples used to reserve by default “configMINIMAL_STACK_SIZE + 100” when creating the task.
So if you try this code inside the task, you can view how “str_buffer” data is overwritten with random characters after executing sscanf.
On the other hand, if you create the task with a little more memory, the code works correctly.