开发者

Linux serial port priority

At present we are using Fedora Core 3 for a system we are working on. This system needs to communicate via serial. The timing of communications is timing critical. At present it seems that the serial driver has delays in pushing the data from the 4k fifo into the 16byte hardware uart.

Is there any way开发者_C百科 in force Linux to treat this action with a higher priority?


Try the using setserial to set the low_latency option.

By default serial ports are optimised for throughput not latency, this option I think lets you change it.


If you have a hard real-time processing requirement, you may be better off using a distribution that's built with that in mind, for example RTLinux.


Consider getting the device vendor to change the protocol to something less stupid where timing doesn't matter.

Having a timing-critical serial protocol, or indeed one which requires you to acknowledge one message before sending the next, is really stupid.

rs232-style serial ports are really slow, and anything which makes them worse is a bad idea.

I wrote a program to control a device which had a stupid protocol - each byte of data was individually acknowledged (duuh!) and the next one wasn't sent until the ack arrived - which meant that the data transfer rate was a tiny fraction of what it should have been.

Look at the zmodem protocol, for example, which is less stupid.

Better still, get the vendor to enter the 1990s and use USB.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜