I have a Python script that is running as a systemd service. It is using a UART and SPI to communicate with an ARM processor. The process performs a blocking read on the serial port waiting for 4 bytes. Using an oscilloscope I measure the difference between when the serial port packet is transmitted and when the read call returns. Most often this value is around 2 ms which is fine. Sometimes (within 20 seconds to a minute) this value is 500 ms and I've seen it be larger than 1 second. If attempted to use `chrt` to change the static priority and scheduling policy. It reports that the values are set correctly but the large latencies remain.
This is with the 3.8.13-bone62 that I rebuilt to increase the SPI buffer. The buffer size was the only change.
Any thoughts on how to improve this? I can probably tolerate up to 100 ms.