Forum Discussion
Altera TSE driver and example program for lwIP (1.3.2)
After many many requests and complaints about lack of support and/or documentation for support of lwIP for the Altera TSE, I have developed a drop-in TSE driver and example program and made this available to the NIOS II community. This was done for NIOS II 8.1 SP0.01. I don't expect difficulty with version 9.x.
This is for the latest version of lwIP (the latest is as of this post) for a minimal program and HTTP server based on the http server in the lwIP contrib folder. The lwIP TSE driver uses the altera_avalon_tse driver and SGDMA as-is. There is a complete (as in 41-step) set of instructions on creating the project and example program. More information and the link to the driver is available here: http://lwip.wikia.com/wiki/available_device_drivers#lwip_1.3.2 Please direct any questions, changes for NIOS II 9.1, or comments to this thread. 12-16-2010 update: This example works with NIOS Version 10.0 with some tweaks to the procedure to create the project. Also, a lwIP 1.4 release candidate has been out for a while and it drops into this example (in place of 1.3) without changes. Bill257 Replies
- Altera_Forum
Honored Contributor
There is a port of lwIP for FreeRTOS. I would think uCOS would be similar to implement (except for the price).
lwIP 1.4.x also now includes an enhanced WEB server with SSI and CGI support. IPv6 is also available in beta and will be out in the next full lwIP update. Bill - Altera_Forum
Honored Contributor
Great news! Maybe someone interested in writing a full manual to alterawiki?
- Altera_Forum
Honored Contributor
What would the alterawiki manual you wish for cover? There exists a wiki for lwIP although I admit it's far from great. lwIP is not really for a complete beginner at all, but it's a great TCP/IP solution and is well worth the effort if you or your company is serious about having a decent TCP/IP-enabled product.
Bill - Altera_Forum
Honored Contributor
Well, I've success running LwIP 1.4.0, but people is still asking for the same stuff that is deep in the forum instead on one place somewhere. That sample design runs fine, but it would be great to improve it by writing a manual how to modify it to add timer support, dma and all other possible optimizations.
- Altera_Forum
Honored Contributor
Yes, you're right - there is very little information to go on after the demo/example is running. Somewhere in this thread I gave a pretty good list of optimizations to implement. This example was meant to be run as easily as possible with the Eclipse IDE and exiting NIOS II libraries. The truth is we use a custom TSE and SGDMA driver because what is there is very inefficient. We also use the FPGA to speed up lwIP further (IP checksum, htons and htonl). We've also had to use UDP when TCP wasn't fast enough.
Bill - Altera_Forum
Honored Contributor
Hm there is simple TSE driver that works, I suppose it's quite good? What about SGDMA? I suppose existing Altera memory-to-memory sgdma should be enough? Anyway, if it's not a commercial secret and You have a spare minute, maybe You can contribute to Altera Wiki?
- Altera_Forum
Honored Contributor
Time for some optimizations.
Do anyone use timers to run lwIP? Now I've defined NO_SYS_NO_TIMERS, but I have resources to add 250ms timer and enable LWIP_TIMERS. However if I undefine NO_SYS_NO_TIMERS, I get a chain of errors in all cases ending in unreferenced sys_now(). Where can I find documentation how to set up stack to use hardware timers? Thanks. - Altera_Forum
Honored Contributor
Thanks for the driver! Works great!
Made a full implementation with FreeRTOS 1.7.0 and LwIP 1.4. Currently working on full integration in the Nios II IDE so it can be used just like OS-II/InternNiche. I hope the port and demo will be added to the FreeRTOS ports / demo's else I will create an install script which sets up the environment. Yea for a much cheaper solution then the other combo ;) - Altera_Forum
Honored Contributor
Great! Keep this thread updated about Your project :)
- Altera_Forum
Honored Contributor
Oke, I created the installer for the BSP, Software Package and Demo. It's available on the FreeRTOS Comunity Contributions page. However I can't post links yet... so if anybody could be so kind to create a link to the port and installer :)
Goto freertos.org in the menu follow "FreeRTOS Interactive -> Download Contributions -> Altera (2) -> Nios updated port and demo for NiosEDS 11.0 and up (includes LwIP)" Currently we are done, but probably we are going to implement multiple PHY support in the near feature. Hope it's all clear...