Loading...
 

STM32MP1 support available in SW4STM32

   With System Workbench for Linux, Embedded Linux on the STM32MP1 family of MPUs from ST was never as simple to build and maintain, even for newcomers in the Linux world.
And, if you install System Workbench for Linux in System Workbench for STM32 you can seamlessly develop and debug asymmetric applications running partly on Linux, partly on the Cortex-M4; you can download a short video showcasing this on the ac6-tools website (registration required).

System Workbench for STM32


Printf support for semihosting/ITM debugging for float variables.

Hello,

I have compiled and tested my code using the System Workbench and works well. However the printf for the float does not work, and gives either a long random number or -0.0000.

Any linker directives should I add to support it? The “-u _printf_float” and the “- -specs = nano.specs” inside don’t work at all too.

Thanks for the opinion.

by default printf and all flavor (aka vsprintf etc..) come without support for float on the std lib ther’s may be some some option or over lib that enabel or add float support

Hello,

However, there is no extra option on enabing floats on that stdlib.

Will there be future updates to support floating point for printf?


France

Hello all,

Looking at this problem, we just discover it was probably due to a small glitch in the linker script provided by ST. There was, near the beginning of the fine a line that reads
_estack = 0x2000FFFF;    /* end of RAM */
This should be, in fact, a byte higher, just after the end of the RAM area, that is:
_estack = 0x20010000;    /* end of RAM */

The problem is that the original setup creates a stack pointer that is not 8-byte aligned, thus causing problems when storing double values in the stack or passing them as parameters.

Editing the linker script shoul correct the problem, so keep us informed. Anyway the correction will be in the next update, due beginning of August.

Bernard


Hello Bernard,

Thanks for the help. I have suspected that there’s an error in the linker directive earlier, but I do not have enough knowledge to modify it. :-)

I got the printfs working for the floats if I used the supplied GCC’s linker scripts and initialization code ones, but I have to set up the tool chain manually. Luckily there is the OpenSTM32, so I can develop the firmware easier.

By the way, could you add the “Enable float for printf” and the “Enable Semihosting” and/or “Enable SWO” checkboxes in the “Project Options”? This allows the programmer to decide whether he/she wants to enable these in the project.


How did you make the printf work ? Did you use the Liviu Ionescu trace library ?

I cannot get sprintf to work with floats either.

I checked the linker script and the _estack is fine

_estack = 0x20020000; /* end of RAM */

I am using an M4 and have the Hard FPU selected.

How do I enable printf with float?