I'm doing some UART stuff between a Raspberry Pi 4B and a custom PCB with an STM32 (LPUART). I am transmitting
hello world\n
constantly, but what's being received is a bit different. It is receiving the correct amount of bytes and it gets some letters correct, but the others are not received properly.
Here's what the receiving end looks like
What could the problem be? Is it a mismatch in UART settings? It's not in the amount of data bits (8), stop bits (1) or parity (no parity). Could it be poor hardware connection? Do you recognize the pattern?
Thanks
EDIT:
Stopped using the raspberry pi because I ran into some problems with it. Now I use an RS232 to USB 2.0 converter and read the serial data with RealTerm on COM3. The first problem was the cryptic documentation in the LPUART1 section of the reference manual. I was directly writing the desired baud rate in to BRR but turned out I needed to write a divider there. Now the bps seems OK.
Still not working. When the STM32 outputs 'A' between 1 second intervals, RealTerm just outputs 0x00 in hex view and %
in Ascii but after a while it starts outputting _
in Ascii view. The BREAK and Error status flags are flashing red. It says 'UART receiver framing error'. Looking at the signal on the oscilloscope, the start and stop bits seem totally fine to me, but apparently they're not. They share a common ground.
I've been trying to get basic UART working for 3 weeks. WTF
I bought a USB-TTL converter and used it instead of a USB-RS232 converter and it works now.