Same problem happens as PR #61 (branch: ams/fix-read-methods). I meet some strange problems. I've made couple tests:
A. send binary data (such .jpg ) to serial A Tx, which connect to serial B Rx
B . send binary data (such .jpg ) to serial A Tx, which connect to serial A Rx
The function readuntil() (read() or nonblocking_read() in branch: ams/fix-read-methods) from Rx port (for both A and B test) will lose one byte every 1023 bytes received, or lose the last byte if I send less than 1024 bytes.
For example, If I send 1024 bytes (raw) to Tx, I got 1023 bytes from Rx port.
If I send 2048 bytes to Tx, I got 2046 bytes from Rx port !
If I send 100 bytes to Tx, I got 99 bytes from Rx port !
This strange problem happens no matter how much baudrate I set, e.g, 115200,921600.
BTW: The software cutecom test binary file send and receive without any problem for above hardware setup !
If I send a pure text file (all ASCII) to Tx, the above problem is gone!
[new test] function sp_blocking_read() : SAME problem: lose one byte every 1023 bytes received, or lose the last byte if less than 1024 bytes was sent !
Same problem happens as PR #61 (branch: ams/fix-read-methods). I meet some strange problems. I've made couple tests:
A. send binary data (such .jpg ) to serial A Tx, which connect to serial B Rx
B . send binary data (such .jpg ) to serial A Tx, which connect to serial A Rx
The function
readuntil()(read() or nonblocking_read() in branch: ams/fix-read-methods) from Rx port (for both A and B test) will lose one byte every 1023 bytes received, or lose the last byte if I send less than 1024 bytes.For example, If I send 1024 bytes (raw) to Tx, I got 1023 bytes from Rx port.
If I send 2048 bytes to Tx, I got 2046 bytes from Rx port !
If I send 100 bytes to Tx, I got 99 bytes from Rx port !
This strange problem happens no matter how much baudrate I set, e.g, 115200,921600.
BTW: The software cutecom test binary file send and receive without any problem for above hardware setup !
If I send a pure text file (all ASCII) to Tx, the above problem is gone!
[new test] function
sp_blocking_read(): SAME problem: lose one byte every 1023 bytes received, or lose the last byte if less than 1024 bytes was sent !