2020-12-07 05:34 AM
The printed message is:
▒▒RT ▒▒▒n▒▒ E▒amp▒▒ ▒▒▒a▒g▒▒ ▒h▒ C ▒▒b▒a▒y p▒▒n▒▒ ▒un▒▒▒▒n ▒▒ ▒h▒ ▒▒RT▒
Instead
printf("UART Printf Example: retarget the C library printf function to the UART\n\r");
2022-02-18 12:00 AM
Thought I'd answer this, even if it's more than one year late. I recently ran into this, too. The issue is the Virtual COM Port (exposed by the ST-Link bit of the nucleo board) doesn't support 7 (or lower) bit word length, apparently. For USART, the parity bit is included in the word length. The example sets the word length to 8 with "UartHandle.Init.WordLength = UART_WORDLENGTH_8B;", so this makes the example not function with the VCP. You'd have to connect solder bridges to expose the serial RX/TX, but then your VCP probably doesn't work anymore (refer to the manual). Or, as a better option, you could just change the example to use "UartHandle.Init.WordLength = UART_WORDLENGTH_9B;" and connect to the VCP with your utility of choice (putty, screen, whatever) with word length 8, 1 stop bit, parity odd