Loading...
 
Skip to main content

System Workbench for STM32


printf through uart

Hello,
I think it is need to add "extern C". I tried and worked well.
.

#ifdef __cplusplus
 extern "C" {
#endif

int __io_putchar(int ch) {
  HAL_UART_Transmit(&huart2, (uint8_t *)&ch, 1, 0xFFFF);
  return ch;
}

#ifdef __cplusplus
}
#endif
 
Collapse/expand modules below