2024-11-25 02:42 PM - edited 2024-11-25 02:43 PM
I have used this method many times on this board (Nucleo-H743ZI) to transmit printf() to usart3 using the following:
int __io_putchar(int ch) {
/* e.g. write a character to the USART3 and Loop until the end of transmission */
HAL_UART_Transmit(&huart3, (uint8_t*) &ch, 1, 0xFFFF);
return ch;
}
[...]
printf("hello world\n")
However, it has now stopped working in my project. HAL_UART_Transmit() still works fine but printf never seems to call __ioputchar.
This same thing is working on my project with the STM32H7B3I-DK, using usart1.
Any Ideas what could've happened?
2024-11-25 02:52 PM
Review with a debugger?
Disassemble, check the library linkage, and understand where in the path from printf() to __ioputchar() it is failing.
syscalls.c ? _write() ?
2024-11-25 03:08 PM - edited 2024-11-25 03:08 PM
it looks like it goes from printf down into __sfputc_r wich looks like it is doing what __io_putchar should be doing...
__io_putchar does not appear in my disassembly, not sure why