Skip to main content
TFara.1
Associate
November 25, 2021
Question

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

  • November 25, 2021
  • 3 replies
  • 1157 views

..

This topic has been closed for replies.

3 replies

Danish1
Lead III
November 25, 2021

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
Super User
November 25, 2021

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
TFara.1Author
Associate
November 25, 2021

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