cancel
Showing results for 
Search instead for 
Did you mean: 

UART example for STM32WB55 "printf" prints gibberish. I see, the characters are sent to "HAL_UART_Transmit" are correct. BLE HRT example prints debug messages correct.

VadymS
Associate II

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");

1 ACCEPTED SOLUTION

Accepted Solutions
DJC
Senior

Looks to me like you simply don't have the UART setting matching between sender and receiver. Ie: sending 8bits with no parity, recieving 7 bits with parity.

A classic issue I hit EVERY 6 months is that the STMIDE setting for UART says "word lenght 8 bits (including parity).

Where as my receiving software says something like "data length = 8 bits" and then the parity is extra. ... these kinds of broken chars is what I see as a result.

I'm too lazy to do the hard-work here, so i just keep trying receiver settings until i see clean text : P

View solution in original post

3 REPLIES 3

You'll need to chase down the plumbing, perhaps code in syscalls.c or otherwise implementing _io_putchar() type functionality.

Tips, buy me a coffee, or three.. PayPal Venmo Up vote any posts that you find helpful, it shows what's working..
DJC
Senior

Looks to me like you simply don't have the UART setting matching between sender and receiver. Ie: sending 8bits with no parity, recieving 7 bits with parity.

A classic issue I hit EVERY 6 months is that the STMIDE setting for UART says "word lenght 8 bits (including parity).

Where as my receiving software says something like "data length = 8 bits" and then the parity is extra. ... these kinds of broken chars is what I see as a result.

I'm too lazy to do the hard-work here, so i just keep trying receiver settings until i see clean text : P

VadymS
Associate II

Thanks!!!

The parity was defined ODD in both sides. But, it starts to work without the parity.