# STM32 usart interface sends data but “128” is added to each sent byte

I'm using the newest version of stm32cubemx to config my hardware. I'm using a Waveshare STM32H743 dev board and it's completely healthy and uClinux works(I can easily communicate with it using that usart) on it.

so, as I stated, it's not a board or connection specific problem. I guess maybe it's a bug in cube that is configuring the registers in a wrong way. but when I read the registers, I couldn't understand how this is happening.

I tried to change parity, stop bits, baudrate and ... randomly on the receiver(that is my pc) but it wasn't helpful. I think there is a problem with the 7th bit. because 7th bit has the value of "128" and the ascii codes that I receive on my computer are wrong and it seems that 128 is added to them.

my program in while(1) loop:

char h[]="hello";
HAL_UART_Transmit(&huart2, h, 5, HAL_MAX_DELAY);
HAL_Delay(500);

• What are your PC settings? What software is used on PC? What is the currently used clock source of STM32 and do you know if it is accurate enough for UART transmissions? Have you looked at the waveform with an oscilloscope? – Justme Oct 11 '20 at 13:40

• thanks for your answer! but I tried it and it didn't work well. when I set my pc to receive with no-parity \ one-stop-bit \ 7-bits it receives this hqq}h5qq}hqq}hqq}... and when I set it to receive with no-parity \ two-stop-bits \ 7-bits it receive the data better but with weird letters(randomly captilized and '\n' not working) : heLLOhellOHEllohELLoHElloHEllohellOhELloHello – Mahyar Shokraeian Oct 11 '20 at 14:14