Skip to main content
Hoang_Tran
Associate III
June 17, 2020
Question

STM32cubeide printf error

  • June 17, 2020
  • 2 replies
  • 2379 views

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

This topic has been closed for replies.

2 replies

Pavel A.
Super User
June 17, 2020

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

Hoang_Tran
Associate III
June 18, 2020

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

Piranha
Principal III
June 20, 2020

Probably stack size to small.

Hoang_Tran
Associate III
June 22, 2020

how to increase task size??