Linux串口优先级

发布于 2024-09-16 19:04:02 字数 149 浏览 2 评论 0原文

目前我们正在开发的系统使用 Fedora Core 3。该系统需要通过串口进行通信。通信的时机对于时机至关重要。目前看来,串行驱动程序在将数据从 4k fifo 推送到 16 字节硬件 uart 时存在延迟。

Linux 有什么办法可以让这个动作具有更高的优先级吗?

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 in force Linux to treat this action with a higher priority?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

烟火散人牵绊 2024-09-23 19:04:02

尝试使用setserial设置low_latency选项。

默认情况下,串行端口针对吞吐量而不是延迟进行优化,我认为此选项可以让您更改它。

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.

飞烟轻若梦 2024-09-23 19:04:02

考虑让设备供应商将协议更改为不那么愚蠢的协议,其中时间并不重要。

拥有一个对时间要求严格的串行协议,或者实际上要求您在发送下一条消息之前确认一条消息的协议,真的很愚蠢。

rs232 风格的串行端口确实很慢,任何让它们变得更糟的事情都是一个坏主意。

我编写了一个程序来控制一个具有愚蠢协议的设备 - 每个数据字节都被单独确认(废话!),直到确认到达才发送下一个字节 - 这意味着数据传输速率只是它本来应该是什么。

例如,看看 zmodem 协议,它就不那么愚蠢。

更好的是,让供应商进入 20 世纪 90 年代并使用 USB。

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.

破晓 2024-09-23 19:04:02

如果您有严格的实时处理要求,那么您最好使用考虑到这一点而构建的发行版,例如 RTLinux

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文