Serial read not reading the entire package in one transaction #1065
-
Hi. I have a STM32 with a RF module attached connecting to a raspberry pi via USB port. I used LinuxSerialDriver to communicate between the two devices. The way I set it up is to have a stm32 to handle RF transaction and put whatever it reads to R Pi via USB port. However, it seems like that the data sent was chopped. To verify that it's not a RF issue, I have a STM32 sending a array of 1-10 via serial port and, as expected, the packet received on R Pi is partially chopped at a random spot at each transaction. I'm wondering if there's a parameter in LinuxSerialDriver that I could adjust this to read the entire package in one go? any help would be appreciated. Btw, I used baud 115200 and no parity bit on both devices. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
It is actually common that the receiving end of a UART transaction will chop packets at different points. This is usually due to buffering in the hardware. You should just structure your logic to assume this will happen and reassemble the packet at a higher level. |
Beta Was this translation helpful? Give feedback.
-
Yes, the |
Beta Was this translation helpful? Give feedback.
It is actually common that the receiving end of a UART transaction will chop packets at different points. This is usually due to buffering in the hardware. You should just structure your logic to assume this will happen and reassemble the packet at a higher level.