2019-07-07 03:18 PM
2019-07-07 03:23 PM
Using STM32CubeIDEwith an STM32L433RBTx micro. I've gone through all the settings and nothing helps.
It formats a string into garbage.
sprintf( strBuff, "%4.2f", (double)12.34 );
strBuff[0] = 0
strBuff[1] = 0
strBuff[2] = 0x2e (Which is correct)
strBuff[3] = 1
strBuff[4] = 0x20
2019-07-07 03:54 PM
2019-07-07 04:39 PM
2019-07-08 01:06 AM
You need to consult the STM32CubeIDE tutorials/documentation. Usually, this is found in the project properties.
This IDE seems relatively new, and bug prone. Consider setting up the project again, with the proper library.
2019-07-08 09:32 AM
It turns out that the fix was to rewrite the _sbrk routine to what was outlined in the first reply. I hadn't looked at it carefully enough initially.
The original _sbrk routine assumes that you have a linear address space and the heap is below the stack always. That is not the case when you use freeRTOS and have multiple stacks that are statically created. I had to add a label to the heap end in the linker script file and follow what was done in the first reply example.
2019-07-08 09:37 AM
The sorry state of the _sbrk has been lamented before... ST still also has code generating unaligned stacks via linker scripts..