无需操作系统的 TCP/IP 协议栈
我正在寻找一个无需操作系统即可使用的 TCP/IP 堆栈。我们的客户“厌恶”中断,并且不希望我们正在构建的嵌入式板上有真正的操作系统。由于我们仅使用 50 至 100 MHz Arm,因此希望将尽可能多的功能转移到 FPGA。我非常确定该客户不会接受 GPL 许可的内容。 (由于与之相关的法律泥潭。他们希望在软件完成后拥有完全不受限制的权利。)
I'm looking for a TCP/IP stack that can be used without an OS. Our customer has an "aversion" to interrupts and doesn't want a real OS on a embedded board we're building. It's desirable to move as much of the functionality to FPGA as possible due to the fact we will be only using a 50 to 100 MHz Arm. And I'm pretty sure GPL licensed stuff won't be acceptable for this client. (Due to the legal quagmire associated with it. They expect to have full unrestricted rights to the software once it's complete.)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(8)
uIP(微型 IP)和 lwIP(轻量级 IP)都是值得考虑的候选者。根据两个堆栈的原始开发人员 Adam Dunkel 的说法,两者之间的主要区别之一是:“lwIP 比 uIP 大,但提供更好的吞吐量”。这两个堆栈均采用修改后的 BSD 许可证,并已用于商业产品中。
uIP (micro IP) and lwIP (lightweight IP) are both candidates worth consideration. According to the original developer of both stacks - Adam Dunkel - one of the primary differences between the two is: "lwIP is larger than uIP, but provides better throughput". Both stacks employ a modified BSD license and have been used in commercial products.
这并不一定能以您希望的方式回答您的问题(它不在评论部分,因为我的谩骂可能会太长)。不过,我认为它可能仍然有帮助。
有几点。我认为你应该重新教育你的客户关于中断的好处和成本。中断是处理设备控制的非常有效方式,除非您对编码非常细致,否则不太可能将性能与非中断驱动的代码相匹配。
其次,使用 GPL 软件将赋予他们对该软件完全不受限制的权利,只是不允许他们限制其他人。如果你的意思是他们确实想要限制他人,那么我会问为什么他们认为他们应该有权使用他人的劳动而没有任何回报。
您很可能能够找到比 GPL 更宽松的许可证的 TCP 堆栈(允许他们有效地封闭源代码)。如果您的 FPGA 有 C 编译器,您可以查看 uIP< /a> 简单看一下它有一个非常宽松的许可证:
就是这样,没有“必须根据 GPL 发布”或任何其他病毒条款,唯一的归属是包含版权声明。
This doesn't necessarily answer your question the way you want it answered (it's not in the comments section since my diatribe is probably going to be too long). However, I think it may still be helpful.
A couple of points. I think you should re-educate your clients on the benefits and costs of interrupts. Interrupts are a very efficient way of handling device control and, unless you're meticulous about your coding, you're unlikely to match the performance with non-interrupt-driven code.
Secondly, using GPL software will give them full unrestricted rights to the software, it just won't allow them to restrict others. If you mean they do want to restrict others then I'd be asking why they think they should have the right to use the labours of others without any give-back.
You may well be able to find a TCP stack under a more permissive licence than GPL (allowing them to effectively close-source it). If you have a C compiler for your FPGA, you can possibly look into uIP which has a very permissive licence from a brief look:
That's it, no "must release under GPL" or any other viral clauses, and the only attribution is the inclusion of the copyright notice.
目前,我在 50MHz 的 ARM Cortex-M3 上使用 lwIP 库,没有操作系统。该项目基于 Luminary Micro(现为 TI)Stellaris 串行转以太网参考设计套件 ( http://www.luminarymicro.com/products/rdk-s2e.html)。
该套件包括源代码和原理图,为我们开发一些产品奠定了坚实的基础。
我与 TI 或 Luminary 没有任何关系,只是一个非常满意的客户。
Currently I'm using the lwIP library on an ARM Cortex-M3 at 50MHz with no OS. It's a project based on the Luminary Micro (now TI) Stellaris Serial to Ethernet Reference Design Kit (http://www.luminarymicro.com/products/rdk-s2e.html).
This kit includes source code and schematics and gives us a solid base to develops some products.
I've no affiliation with TI or Luminary, just a very happy customer.
我已经为 Texas Instruments 16 位 DSP 在“裸机”上编写了一个以太网+TCP 堆栈。缺乏字节范围的寻址是相当麻烦的。一些数据结构存储每个字两个字节的数据,而其他数据结构每个字存储一个字节(在 C 编译器中,“char”和“int”都是带符号的 16 位类型)。以太网或 TCP 代码均不使用中断;两者都以“尽可能频繁地调用”例程进行处理,该例程通常循环次数约为 100 次/秒。性能虽然不是超级出色,但总体来说已经足够了。也许我的堆栈中最大的弱点是它不能处理无序数据包(无序到达的数据包将被忽略;它们有望在预期数据包到达后重新传输)。您所寻求的当然是可行的,尽管这并不一定意味着值得付出努力。
顺便说一句,我的 TCP 堆栈在端口 23 上支持一个相当有趣的“回显服务器”。任意数量的 telnet 客户端都可以连接到端口 23,并且它们发送的任何数据都将返回给它们。尽管该服务器只是回显数据,但它可以适合完全无状态地发送文档等内容。有人见过这样的事情吗?
I have written a Ethernet+TCP stack on 'bare metal' for a Texas Instruments 16-bit DSP. The lack of byte-wide addressing was rather a nuisance; some data structures store data packed two bytes per word, while others store one byte per word (in the C compiler, both 'char' and 'int' are signed 16-bit types). None of the Ethernet or TCP code uses interrupts; both handled in a "call as often as convenient" routine which typically cycles around 100x/second. Performance is not super-duper, but it is generally adequate. Perhaps the biggest weakness in my stack is that it doesn't handle out-of-order packets (packets arriving out of sequence will be ignored; they'll hopefully get retransmitted after the expected packets arrive). What you're seeking is certainly doable, though that doesn't necessarily mean it's worth the effort.
BTW, my TCP stack supports a rather interesting 'echo server' on port 23. Any number of telnet clients can connect to port 23, and whatever data they send will be given back to them. Although this server just echos data, it could be adapted to send things like documents completely statelessly. Anyone ever seen anything like that?
只需添加一点说明,飞思卡尔的 FNET 中有一个相当新的开源 TCP/IP 堆栈,专门用于 MCU。它是 LGPL/GPLv3 许可的,与其他一些 BSD 许可的许可不同,因此它可能不适合原始发布者的项目,但它可能仍然与其他用户相关。目前将 Kinetis (Cortex-M4) 以及一些 ColdFire 部件列为受支持的平台。
Just adding a note that there's a fairly new open source TCP/IP stack intended for MCUs in Freescale's FNET. It's LGPL/GPLv3 licensed, differing from some of the other BSD licensed ones, so it may not be suitable for the original poster's project, but it may still be relevant to other users. It current lists Kinetis (Cortex-M4) as a supported platform along with some ColdFire parts.
好吧,我在研究 FNET 时偶然发现了这篇文章,虽然它很旧,但没有得到解答,所以我会添加我的两分钱......
Micromonitor 是一个启动监视器,当独立运行时,支持 TFTP 客户端/服务器、DHCP 客户端、ping 客户端/服务器和基于简单 UDP 的命令行界面。
它包括演示应用程序,允许您将 LWIP 直接挂钩到引导监视器使用的底层以太网驱动程序。这使得该演示可以在任何微监视器端口上使用,几乎无需任何更改。
没有中断,没有 GPL...只是一个轮询循环。示例应用程序包括几种不同的连接:(LWIP、LUA、PICO-C、BWBASIC 等)。该演示包含一个 HTTP 服务器
(与 uMon 的 TFS 文件系统挂钩,因此您只需构建 html 基本文件)、基于 UDP 的命令服务器、telnet 客户端和 http-get 客户端。大多数演示都是演示的扩展
LWIP 附带的。
看看... http://www.umonfw.com
Well, I stumbled on this post as a result of looking into FNET, and although its old, its not answered, so I'll add my two cents...
Micromonitor is a boot monitor that when run standalone, supports TFTP client/server, DHCP client, ping client/server and a simple UDP based command line interface.
It includes demo applications that allow you to hook LWIP directly to the underlying ethernet driver used by the bootmonitor. This allows the demo to be used on any micromonitor port with almost no change.
No interrupts, no GPL... just a polling loop. The example applications include several different hookups: (LWIP, LUA, PICO-C, BWBASIC, etc..). The demo includes an HTTP server
(hooks to uMon's TFS file system so you just build up html basic files), UDP-based command server, a telnet client and http-get client. Most of the demos are extensions of the demos
that come with LWIP.
Check it out... http://www.umonfw.com
您可以使用 Simulink Embedded Coder 来实现它。然后,如果需要,您可以修改生成的代码。 (当然,如果您有其他选择,例如上述解决方案之一,则不建议您这样做。)
You can use Simulink Embedded Coder to implement it. And then if you need, you can modify the generated code. (Ofcourse it is not advised if you have another option such as one of the solutions stated above.)
对于阅读此帖子的任何人: https://github.com/cesanta/mongoose 是裸机TCP/IP 堆栈,包括:
mongoose.c
和mongoose .h
For anyone reading this thread: https://github.com/cesanta/mongoose is the bare-metal TCP/IP stack which includes:
mongoose.c
andmongoose.h