Long after most people has thought serial ports are dead, I have a problem.
I am running Fedora Core 4, on a Toshiba PM-2.0GHz Laptop.
My application is collecting video data (via coriander on Firewire) and GPS + inertial data on a serial port, via a custom application.
Each program on their own works well.
However, when we start streaming images, we are losing data on the serial port. Interestingly, we are NOT getting the same problem on the USB port.
This is what I have gathered so far:
- From /proc/tty/driver/serial, there are quite a few overrun errors, and data is being lost. Port is set to the usual /dev/ttyS0 parameters automatically, including IRQ.
Given that the USB-serial convert works in the same instance, it is almost certian that the 16-byte FIFO on the 16550A uart is being overrun, since it is not getting serviced fast enough.
From a couple of days of googling, it looks like a receive interrupt is generated after 14 bytes, meaning at the decent data rates (well, relative to serial
) we are using, the 2 bytes could be easily overrun. It's like this to minimise the number of rx interrupts the CUP has to service.
The problem is, neither setserial, stty, ioctrl or termios allow the receive interrupt trigger to be easly changed. Ironically, you can acutally change this quite easily in windows...
I have also investigated changing the IRQ priority, which seemed to have some success for PPP irqtune utility.
Unfortunantly, it refuses to install under FC4. See linuxforums.org/forum/peripherals-hardware/31952-i-thought-ext-usr-modem-would-work-umm-no.html[/url] to see what the problem there is (and yes, I tried all what was said there, and more).
Hence, I'd love if somone has information on the following
- Setting the Recieve interrupt trigger level on the 16550A UART
- Changing the priorities of IRQs under a 2.6 kernel.