Skip to main content
VadymS
Associate
January 24, 2021
Solved

printf is not working. Uart is working. What can be a reason?

  • January 24, 2021
  • 1 reply
  • 1164 views

I took the "Examples\UART\UART_Printf" as reference and added the EmbOS. Printf worded with embOS.

In some steep, after project clean or some project changes, the printf stopped to work.

Uart works.

I use STM32CubeIDE.

What can be a reason?

This topic has been closed for replies.
Best answer by Vangelis Fortounas

Hello

define fputc function like this

int fputc (int ch, FILE * stream)

{

   HAL_UART_Transmit(&huart1,(unsigned char*)&ch,1,100);

   return ch;

}

This is also an good article about semihosting in CubeIde

1 reply

Vangelis Fortounas
Associate II
January 24, 2021

Hello

define fputc function like this

int fputc (int ch, FILE * stream)

{

   HAL_UART_Transmit(&huart1,(unsigned char*)&ch,1,100);

   return ch;

}

This is also an good article about semihosting in CubeIde