开发者

TCP/IP Protocol stack without an OS

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 开发者_Python百科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.)


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.


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:

Copyright (c) 2001-2006, Adam Dunkels and the Swedish Institute of Computer Science

All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

  3. The name of the author may not be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE AUTHOR `AS IS' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

That's it, no "must release under GPL" or any other viral clauses, and the only attribution is the inclusion of the copyright notice.


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.


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?


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.


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


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.)

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜