Skip to main content
Senior
December 13, 2024
Question

assertios "REENT malloc succeeded" failed, RTOS and printf

  • December 13, 2024
  • 2 replies
  • 656 views

My project is fully working with touchgfx and FreeRtos; however, I need to add in a printf("%f") statement. Whenever I use %f i get the following error:

 

assertios "REENT malloc succeeded" failed: file "/build/gnu-tools-for-stm32_12.3
.rel1.20240926-1715/src/newlib/newlib/libc/stdlib/dtoa.c", line 239

 

 I have used printf("%d") fine. I tried following others advice of generating a new project and copying over the sysmem.c file to the new version of sbreak, but when I do that my project no longer works as expected.

Is there another way to fix specifically the printf issue without having to risk the integrity of the rest of my project?

This topic has been closed for replies.

2 replies

Pavel A.
December 14, 2024
ST Technical Moderator
December 16, 2024

Hello @EthanMankins 

Please ensure that you are enabling the use of floating point with printf in your STM32CubeIDE project.

Saket_Om_0-1734358759751.png

 

In order to give better visibility on the answered topics, please click on 'Best answer' on the reply which solved your issue or answered your question. Saket_Om