Loading...
 

SW4STM32 and SW4Linux fully supports the STM32MP1 asymmetric multicore Cortex/A7+M4 MPUs

   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 get more information from the ac6-tools website and download (registration required) various documents highlighting:

System Workbench for STM32


Problem with sprintf and float numbers

First of all, Merry Christmas to everybody.

I have a problem using sprintf with float numbers and would appreciate if someone could help me.

Using sprintf with float numbers doesn’t work at all. I have search into the forum and used all hints that I found but without any success.

This post http://www.openstm32.org/tiki-view_forum_thread.php?comments_parentId=2108Question says that it is needed these linker flags “-specs=nosys.specs -specs=nano.specs -u _printf_float”. In this other post http://www.openstm32.org/tiki-view_forum_thread.php?comments_parentId=1838Question it is sugested to use syscall.c file or “-specs=nosys.specs” linker flag. This post http://www.openstm32.org/tiki-view_forum_thread.php?comments_parentId=954Question says to enable float support adding the linker flag: “-u _printf_float”.

With all this information I have tried all possible combinations of linker flags with different results:

Using sprintf(BufferTx,”Welcome %d %g %s\r\n”, 15, 16.56789, “hello”);

I have obtained these results:

-specs=nosys.specs -specs=nano.specs -u _printf_float
Jumps to HardFault_Handler.
-specs=nosys.specs -u _printf_float
Only prints “Welcome 15” and program stops working properly.
-specs=nosys.specs
Only prints “Welcome 15” and program stops working properly.
-u _printf_float
Jumps to HardFault_Handler.
-specs=nosys.specs -specs=nano.specs
Doesn’t print any float number at all but program still works properly.
-specs=nano.specs
Doesn’t print any float number at all but program still works properly.
-specs=nano.specs -u _printf_float
Doesn’t print any float number at all but program still works properly.
without any of these linker flags
Only prints “Welcome 15” and program stops working properly.

I have update my system to

C/C++ Debugging Tools for MCU Version: 1.11.2.201612060912
C/C++ Embedded Development Tools for MCU Version: 1.12.0.201612060912
Linker Script Editor Version: 1.11.0.201611241417
C/C++ Debugging Tools for MCU Version: 1.0.6.201612060912

but the problem persists.

Could you give me some hints to solve this problem?.

Thanks in advance.

PD: I forgot to say that the project was generated with STM32CubeMX for STM32L4Discovery board (STM32L476VG CPU) using HAL, FreeRTOS, 3 tasks and 1 USART.

This topic can be closed. It was a stack overflow problem.
The stack size (512 bytes) of FreeRTOS task was not enough to call sprintf function. This is surprising, at least for me, because the task does nothing but call sprintf function.
Thanks.
jmpardo.

Thank you!
Solved my issue as well!

Ukraine

cool!!! had this trouble! resolved this as adds more stack size for task with float point processing.
Tnx!


Thank you, your answer helped me.