Skip to main content
VadymS
Associate
Jan 24, 2021 12:26 PM UTC
Solved

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

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.
Vangelis Fortounas
Associate II
Jan 24, 2021 2:05 PM UTC

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
Jan 24, 2021 2:05 PM UTC

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