2019-09-23
2019-09-23
In the last post you said “The software is good shape.”
I plug both boards into my workstation. Start the software. Error messages start spewing about bad checksums, buffer overflows etc. Narrow it down to a specific serial port. The serial port that’s built into the motherboard works just ducky.
The port that’s an add-on card is causing problems. Start investigating. Eliminate cable, IO board, configuration, etc. Both ports work fine in text/human mode, but in binary mode the add-on card is simply not cooperating. After turning on copious debugging output the main difference becomes apparent. The built into the motherboard serial port releases data in maximum 10 byte chunks. Where as the add-on serial port releases data in chunks up to 120some bytes.
Long story made short, the underlying cause of the problem was that my code would stop processing serial port data after the first complete message. This was not a problem when the serial port would release data in 10 byte chunks, but when the data was coming out of the veritable horn-of-plenty of data in 100some-odd byte chunks, the receive buffer would overflow.
It’s now fixed. Everything works (for now).