Retargeting printf on STM32F746G
Hi,
I'm using STM32CubeIDE and I'm trying to retarget printf to the USART1 of the STM32F746G.
USART1 of the MCU is connected to the ST-Link Virtual com. I have tested the connection the USART1 directly using the function "HAL_UART_Transmit(&huart1, "A", 1, 0xFFFF)" this does work meaning that the hardware is correctly setup. So far I have implemented __io_putchar() function in my main.cpp like the following :
int __io_putchar(int ch)
{
/* Place your implementation of fputc here */
/* e.g. write a character to the EVAL_COM1 and Loop until the end of transmission */
HAL_UART_Transmit(&huart1, (uint8_t *)&ch, 1, 0xFFFF);
return ch;
}
I took the code from the one of the example in the STM32Cube_FW_F7_V1.15.0 but for an other board since there is no UART_printf example for the STM32F746G.
Any of what could be wrong with my implementation ?