Skip to main content
LBern.1
Visitor II
September 1, 2020
Question

Printf no redirect

  • September 1, 2020
  • 0 replies
  • 557 views

Hello, in my project I'd like to use printf for print debug messages, but if write printf("Test"), I don't see the string on the UART.

I have redirect printf:

#ifdef __GNUC__

 /* With GCC, small printf (option LD Linker->Libraries->Small printf

  set to 'Yes') calls __io_putchar() */

 int __io_putchar(int ch)

#else

 int fputc(int ch, FILE *f)

#endif /* __GNUC__ */

{

  UartWrite( UART1, (uint8_t*)&ch, 1, 0 );

  return ch;

}

The code no entry in the function fputc, why ?

Best regards

Luca

This topic has been closed for replies.