简体   繁体   English

Linux串口优先级

[英]Linux serial port priority

At present we are using Fedora Core 3 for a system we are working on. 目前我们正在使用Fedora Core 3来构建我们正在开发的系统。 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. 目前,似乎串行驱动程序在将数据从4k fifo推送到16byte硬件uart时有延迟。

Is there any way in force Linux to treat this action with a higher priority? 有没有什么办法可以让Linux以更高的优先级处理这个动作?

Try the using setserial to set the low_latency option. 尝试使用setserial设置low_latency选项。

By default serial ports are optimised for throughput not latency, this option I think lets you change it. 默认情况下,串行端口针对吞吐量而非延迟进行了优化,我认为此选项可让您更改它。

如果您有一个严格的实时处理要求,那么最好使用基于此构建的分发,例如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. rs232风格的串口真的很慢,任何让它们变得更糟的东西都是个坏主意。

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. 我写了一个程序来控制一个有愚蠢协议的设备 - 每个字节的数据都被单独确认(duuh!)而下一个没有发送,直到ack到达 - 这意味着数据传输速率只是一小部分应该是什么。

Look at the zmodem protocol, for example, which is less stupid. 例如,看看zmodem协议,它不那么愚蠢。

Better still, get the vendor to enter the 1990s and use USB. 更好的是,让供应商进入20世纪90年代并使用USB。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM