cancel
Showing results for 
Search instead for 
Did you mean: 

I am trying to program the LPUART of the STM32WB5MM-DK to print a simple message on a terminal application with a separate USB to UART converter (not the virtual comm port). I keep getting garbage output, please help with this. Thanks

TFara.1
Associate
 
3 REPLIES 3
Danish1
Lead II

Give us a clue.

Unless you tell us what you're currently doing, we can't say what you need to change to make it work.

Garbage can mean that your baud rate is wrong.

Or that the polarity is wrong (logic-level signalling is reversed from "RS232" levels).

TDK
Guru

Most likely the baud rate, data bits, or polarity settings are mismatched between the two.

If you feel a post has answered your question, please click "Accept as Solution".
TFara.1
Associate

Thank you for your responses. I'm just trying to run these lines of code on CubeIDE to print a simple "Hello" message at my serial terminal:

 strcpy((char*)char_buf, "Hello!\n");

 HAL_UART_Transmit(&hlpuart1, char_buf, strlen((char*)char_buf), HAL_MAX_DELAY);

 HAL_Delay(100);

The LPUART1 parameter settings are:

Baud rate: 9600 bps

Word length: 8 bits (including parity)

Parity: None

Stop bits: 1

At the moment, I am getting nothing on my desktop serial terminal (which are also configured to the same settings, i.e. baud rate, etc)

Many thanks for your help and suggestions