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
Igor, are you also using udp_sendto_if? If not, try it - you'll find it makes things faster still.
Bill - Altera_Forum
Honored Contributor
Hi guys. Finally i have found what was a problem.Why i could not to run not "simple_server..." and not a BillA'a example. They,both, has been configured to work with GMII/MII interfaces and my evaluation board has been configured and connected to work with RGMII interface.
So if anyone meets the same mistake,now you know the reason and solution is here: http://www.altera.com/support/kdb/solutions/rd11122009_293.html P.S. From my side the problem is solved. Thank you,all. Slava - Altera_Forum
Honored Contributor
Hi rapa,
I am facing the same problem what u hv faced. I followed whatever mentioned in the link, u provided in last mail for rgmii interface with tse mac. I am also using Cyclone III Development Kit board and I am not able to ping the board. I do not see any packets from the board in the network(using TCP/IP sniffer) and no activities on TxD line. When I tried to connect PC to board(on sniffer I see it as a broadcast at ARP level.) Please help. The output is following: Running... INFO : TSE MAC 0 found at address 0x10022800 INFO : PHY Marvell 88E1111 found at PHY address 0x12 of MAC Group[0] INFO : PHY[0.0] - Automatically mapped to tse_mac_device[0] INFO : PHY[0.0] - Restart Auto-Negotiation, checking PHY link... INFO : PHY[0.0] - Auto-Negotiation PASSED MARVELL : Mode changed to RGMII/Modified MII to Copper mode MARVELL : Enable RGMII Timing Control MARVELL : PHY reset INFO : PHY[0.0] - Checking link... INFO : PHY[0.0] - Link not yet established, restart auto-negotiation... INFO : PHY[0.0] - Restart Auto-Negotiation, checking PHY link... INFO : PHY[0.0] - Auto-Negotiation PASSED INFO : PHY[0.0] - Link established INFO : PHY[0.0] - Speed = 1000, Duplex = Full Waiting for link...OK IP address: 172.194.11.100 is there any other considerations that I hv to take for rgmii interface or any other issues? please help me out.... Best regards and many thanks to all the guys for providing lot many info... - Altera_Forum
Honored Contributor
hi all...
I got it working..Just I followed the contents of the earlier post link,correctly. bye.. - Altera_Forum
Honored Contributor
Hi All,
Went through the build and upon execution I see Running... and nothing else. Playing with it (get this) I copied thje printf that puts running on the screen and only get 1 line - removal of the "\n" character gives me Running...Running... before it hangs. can anyone give ma an idea of WHAT could be going on here? Chris - Altera_Forum
Honored Contributor
Chris,
Are you using 10.0 and using the VIC? With a new design using lwIP we're using 10.0SP1 and I'm trying to get some form of this demo running. Right now I'm just getting our configuration side ironed out because it's not running as-is - but it could be the SOPC side of things. If you have design the VIC in, it might run if you disable it in the BSP editor. A user did report this runs in 9.0 so I suspect there might be a VIC compatibility issue (assuming he didn't use the VIC - if he did then it should run as-is). If there is a problem in the lwIP driver I'll update this demo ASAP as I need lwIP for the new product using 10.0 and the VIC. Thanks, Bill - Altera_Forum
Honored Contributor
Hi Bill
I'm in 9.1 SP2 - I am not using the vectored interrupt controller... this is very strange... I did have to jump through hoops to get the image to build, changing paths to point to my .h files explicitly... - Altera_Forum
Honored Contributor
Hi Chris,
I think I need to update this demo to fit the 9/10 SBT model, since the current demo is in CDT mode. If you create a blank project in 9.x/10.x and import lwip and the files in this example, you'll have an SBT project. Use NIOS II Application Paths in NIOS II Application Properties to add the arch, src/include, and src/include/ipv4 include paths (browse to them if I have it wrong here) and it will build. I've done this already and can build and run the example as-is in 10.0SP1 with a SOPCINFO that does not have the VIC (which is why I think there may be or is a VIC issue). Bill - Altera_Forum
Honored Contributor
Hi Bill,
I have the example building and am farther along (until I started to add the Broadcom switch that I am interfacing to via rgmii I was seeing running... listening............ I take it that that is a good sign... anyway I am looking to port this demo application to run under ucosII in UDP mode for performance - was wondering if you knew around which time frame Altera moved their socket server example from lwip to the interniche codebase and if it was a ucosII implimentation. I have the url of the altera code dump (having all code from god knows when till now...) I was hoping you could give me a timeframe I might look thru instead of wading thru downloads. Thanks - best crayner - Altera_Forum
Honored Contributor
Hi Chris,
From memory, version 8.x and later were shipped with InterNiche with "lwIP no longer supported". I've seen posts that lwIP was in version 7.x but I've not seen it - I started with 8. For best performance, use lwIP in RAW API mode. Since lwIP needs an RTOS for the Netconn and Socket APIs and has to use message posting to exchange data, lwIP is not very efficient with these APIs and an RTOS. In fact, it's a rule that lwIP be used only in one thread. Now, you can put lwIP in one uC/OS-II thread and use raw API mode, but you can't send data without some mechanism for that thread to grab the data to send. As receiving is normally done with callbacks, by default you're in the lwIP thread and the callback can send data directly. I use a cooperative RTOS which is much safer and because it's cooperative I can have other threads send data to the stack (because the lwIP thread isn't in the lwIP code at those times). Probably with a Mutex around *all* lwIP calls you can use a preemptive RTOS and keep it threadsafe. Once you move to message boxes to get and send data to the stack, it slows way down. Hope this helps! Bill