[Ftdi-usb-sio-devel] FTDI Serial Driver Question
Brought to you by:
bryder
From: Edward D. <Ed....@no...> - 2007-03-15 13:24:07
|
Hello, I work for NOAA (National Oceanic and Atmospheric Administration) in Oak Ridge, TN and we've got a multi-port serial device (ByteRunner USB-8COMi-RM-120V) URL: http://www.byterunner.com/byterunner/product=name:USB-8COMi/title=USB+to+8+Port+Serial+Adapters+(RS422,+RS485) with the FTDI chipset running with the latest version of Fedora Core 6. I don't know the exact kernel, but it is at least 2.6.16. We have been having a few problems about which I would like to ask your opinion. I'll start by outlining the serial loading of each serial port and describing the problems we are having, followed by some questions. Hopefully you can give some insight as to what might be going on. Below are the devices and a description of the amount of serial data and the timing of the data we receive: Device 1 - 35 bytes every 20 ms, baud rate 460800, RS-422 Device 2 - 35 bytes every 20 ms, baud rate 460800, RS-422 Device 3 - 26 bytes every 50 ms, baud rate 115200, RS-232 Device 4 - 12 bytes every 20 ms, baud rate 19200, RS-232 Device 5 - 36 bytes every 50 ms, baud rate 9600, RS-232 Device 6 - 318 bytes every 100 ms, baud rate 115200, RS-232 Device 7 - 238 bytes at 00 ms, 168 bytes every 100 ms until next even second, baud rate 115200, RS-232 Device 8 - 56 bytes every 100 ms, baud rate 115200, RS-232 Here is another look at the sum total of the data, as a function of time: 00 ms - 756 bytes 20 ms - 82 bytes 40 ms - 82 bytes 50 ms - 62 bytes 60 ms - 82 bytes 80 ms - 82 bytes 100 ms - 682 bytes 120 ms - 82 bytes 140 ms - 82 bytes 150 ms - 62 bytes 160 ms - 82 bytes 180 ms - 82 bytes 200 ms - 682 bytes ... and the pattern repeats until the next even second, when the 756 byte burst comes again. I have written c-code to gather data from each device and print it to the screen as a test to see if things are working. The devices are tested individually with separate test programs and once everything is working I run a multi-threaded program to simultaneously collect data from each device and store it to a common data file. I am using an intermediate serial library (SIO from Tim Hudson, http://svn.gnumonks.org/branches/scez-ng/sio/) to provide linkage between the serial drivers and my application code. One other key point is that the traffic is all one-way, receive only. I don't send any data to these devices so the computer just sits back and listens to each device and archives data. Now for the problems... The test code for the first 5 devices works fine when plugged into the USB serial ports. But devices 6, 7, and 8 fail intermittently when plugged into the USB serial ports. In the case of device 7, data flow is fine for several seconds, followed by fairly regular checksum errors, then the program terminates with a segmentation fault error. I can plug the same device into the built-in serial port on the computer (/dev/ttyS0) and the test code runs flawlessly, without the CRC errors or the segmentation fault. I get very lethargic performance with device 8 when it is plugged into the USB serial ports (but at least no segmentation fault!), but flawless performance when plugged into the built-in serial port (again, same test code in both cases). My questions: Are there any differences between the drivers for the "built-in" serial port (/dev/ttyS0) and the FTDI USB devices? I'm thinking about buffer sizes in particular. Also, are there any "tweaks" I can do to the buffer sizes for the USB FTDI driver that might help my particular situation? I'm thinking about handling the serial burst loads that will appear every second and 1/10 second when the full system is up and running. I also noticed some flags in the FTDI serial structure regarding throttling and non-throttling of serial ports. Could there be anything there that might degrade (or improve?) performance? I'm not sure whether the USB interface for this device is 1.0, 1.1, or 2.0, or whether it would make a difference. At this point, any suggestions would be appreciated! Thank you for your time and for developing the FTDI serial drivers! Best regards, Ed Dumas NOAA/ATDD |