cancel
Showing results for 
Search instead for 
Did you mean: 

STM32cubeide printf error

Hoang_Tran
Associate III

I started working with STM32CubeIDE recently. I use STM32f407VET6. I am having an error with the printf () function. When I call the function, the program will jump to HardFault_Handler (void). I have redirected the function using ITM_SendChar (* ptr ++) ;. When I made the error correction I noticed that the program calls puts instead instead of printf (). .

help me please0693W000001quQIQAY.png

4 REPLIES 4
Pavel A.
Evangelist III

Do not replace printf. Replace __io_putchar or _write.

>  I noticed that the program calls puts instead instead of printf

This is normal, GCC compiler does this when the printf format is a simple string.

-- pa

Yes, I replaced the _write function above. But the program never went into the _write function.

Piranha
Chief II

Probably stack size to small.

how to increase task size??