Loading...
 
Skip to main content

System Workbench for STM32


printf through uart

Hello,

Thank you for the usefull infos.
By copying the syscalls.c file into my project and adding the flollowing function at the end of my main.c, I managed to get some output on a serial monitor by calling print().

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


But in a project converted to C++, doing the exact same modifications does not work. The function _ _ io_putchar() is never called.

Does anyone know what could cause that?

Thanks.

 
Collapse/expand modules below