1 问题描述
I write a uart program using c++ on Jetson Nx(Jetpack 4.6.1,Ubuntu version 18.04 LTS) to communicate with a PC. On PC there’s a uart simulator( as below figure 1) sending data at a period of one second, 30 bytes data are : EB90021112131415161718191A1B1C1D1E1F202122232425262728292A2B
When my program receive the data, it will lost the first byte “EB”, and sometimes more bytes are lost. as show in figure 2:
Besides, I tried more tests:
1 C code check. I run my c code on a PC( Ubuntu 18.04.6 LTS os on a windows virtual machine), it doesn’t lost byte. As show in figure 3 above:
2 I changed my c code as below ,set a un-blocking mode, it will not lost any data. Thren I change back to blocking mode as below, it won’t lost any data; and then I restart the Nx, and run my original code(blocking mode), the lost first byte ap