cancel
Showing results for 
Search instead for 
Did you mean: 

Hello everyone. I'm having a problem with serial data transmission.

MZarb.1
Associate II

I'm using a STM32L152C-Discovery and a USB-RS232 adapter to receive data via UART protocol from the board. The system clock is 32 MHz and I'm using a baud rate of 115200 and no parity check. To view the messages on the PC, I use Putty configured consistently with the transmission parameters. When I try to send data via HAL_UART_Transmit the serial monitor shows completely different data. In the case of repeted "Hello world" message I get the following result:

0693W00000Y9hTjQAJ.png 

I also thought about low precision clock problems, if this were the case, how can I verify the correctness with the oscilloscope?

12 REPLIES 12

RS232 has different levels, and inverts, so data will often look as shown, ie patterns consistent, size/form, but wrong characters.

The UART outputs CMOS levels, not RS232

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

example:sprintf("Hello\n\r");

Guenael Cadier
ST Employee

Hi @MZarb.1​ 

Does your configuration have Parity enabled ?

If so, could you provide :

  • your Putty configuration
  • UART instance configuration parameters

in terms of wordlength, stop bits, parity ?

Please note that in case of enabled parity, parity bit is included in word length on STM32 side, which is not the case on Putty config side.

Regards