Pages: [1]   Go Down
Author Topic: DUE ethernet performance on W5200 with SPI and SPI+DMA  (Read 6357 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Jr. Member
**
Karma: 9
Posts: 75
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Most of the older Ethernet shields have the wiznet w5100  chip.  I have a wiznet WIZ820io with the newer w5200 chip. The w5200 has 32KB of buffers (vs 16KB on w5100), and will run at up to 33.3mbs (megabits/second) over SPI (0.3mbs on w5100).  I added the support mods for the W5200 to w5100.cpp and w5100.h in  hardware/arduino/sam/libraries/Ethernet/utility/.  There is also a minor/optional modification to Ethernet.h. Those updated files and early performance results (wizperf.txt) can be found at
   
     https://github.com/manitou48/DUEZoo

Simple UDP tests included 8-byte echo latency (microseconds), UDP 1000-byte packet sends from DUE, and lossless receive rate for 1000-byte UDP packets.  The wiznet chip devotes 2048 bytes to each send and receive buffer (per socket).  UDP is a lossy protocol.  TCP will typically be slower, but it is reliable and adapts to available bandwidth.

Results include tests on the UNO and maple.  On the maple and DUE, one can test SPI+DMA. The wiznet site only guarantees 33.3mbs SPI performance for the W5200.  I got reliable results at SPI speeds of 28MHz, but errors at 42MHz.  The DMA network tests for the DUE are still in progress and will be posted later on this thread at the git URL above.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 4
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I was did a project about using DUE and W5100 shield as a HTML server in a LAN recently, but it was instable, on average every work two days die once, i don't know what reasons caused this problem. In before i was using UNO and it work well, i guess maybe the DUE is still in state of beta?
Logged

Offline Offline
Jr. Member
**
Karma: 9
Posts: 75
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I've added the SPI+DMA w5200 Ethernet results to git link below.  With DMA and SPI clock at 28 MHz, one gets nearly 16 million bits/second, about 3 times the SPI-only performance.  The file w5100.cpp.dma1 is the modified version of w5100.cpp that supports w5200 and DMA+SPI.  Results are in wizperf.txt at

   https://github.com/manitou48/DUEZoo

DMA code is modified from fat16lib's SD work.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 24
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

mantoui,

I finally got a couple WIZ820io with the W5200 chip.  I'm trying to replicate your results on the Due but I'm running into difficulties.

I have it hooked up per the picture I made, hopefully this helps someone else or if I have it hooked up wrong please let me know:



My main problem is that using your modified Ethernet.h and updated w5100.cpp and w5100.h files I'm having a problem with the device locking up if I press the F5 button on my Firefox browser too many times.  It seems that if I press the F5 key about once every half a second the Due will crash/lock up and afterwards will not respond to ping or http.  Only a reset of the Due through pressing reset button or re-uploading the sketch will allow it to be pinged once again:



Let me know if you have any ideas, I would love to get this thing running reliably.  I would hate to be impatient hundreds of miles from home and crash my due/W5200 remotely just because I was hitting refresh on my smartphone too often. Haha!

I'm running the WebServer sketch under:
hardware\arduino\sam\libraries\Ethernet\examples\WebServer

I have been able to verify that the R3 version of the Arduino Ethernet shield running the W5100 chip does not suffer from this problem.  In fact I can hold down the F5 key and it will not drop ping and will continue to respond to http.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 4
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I have exactly the same problem. Any help...
Logged

0
Offline Offline
Newbie
*
Karma: 4
Posts: 42
Arduino rocks - Yeah Baby!!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I have an alternative Wiznet W5200 library that I've ported from work I did with on previous Arduino boards, both 328 and 1284 based. Its at https://bitbucket.org/thiseldo/ethernet52due.

This doesnt replace the w5100.cpp and w5100.h files in the main distribution Ethernet library so will be available after fitire IDE updates. I've also updated it to use the extended SPI features as well as increasing the SPI clock to 42MHz. At present the examples are configured for this library, the only change you'd need to do to use it instead of the standard library is to use the header file Ethernet52Due.h instead of Ethernet.h. The library may still have problems as its still being worked on to improve performance and reliability.

Hope this helps.

Andy
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 24
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

AndyL,

Thanks for the link to your library.

I was able to download it and run the WebServer sketch and just like you said in another thread I was able to run 8 firefox tabs each pulling data every few seconds!  Awesome! I was never able to do that with the official Ethernet shield so that is a positive step forward.

I was still having the same problem though where if I perform too many requests (pressing F5 in browser) to the W5200 chip it will basically lock up and stop responding to any GET requests from the browser and also stop responding to ICMP (PING).  Even an hour later it still does not come out of the stuck condition.

Are you having the same problem?

I'm starting to think there may be a bug in the chip because the exact same thing happens when I have the W5200 chip hooked up to the Arduino UNO running Arduino IDE Version 1.0 with the official (from WIZnet) libraries:
http://www.wiznet.co.kr/sub_modules/en/product/Product_Detail.asp?cate1=5&cate2=42&cate3=0&pid=1161#tab
If you go to the link above and click on the "Download" section there are a couple zip files containing WIZnet's updated W5100.h and W5100.cpp files so you can run the W5200 chip.  The code from WIZnet has the same problem locking up when too many requests come in.  Maybe the request Internal 32 Kbytes tx/rx buffer is getting filled and causing it to crash?

Logged

Venezuela
Offline Offline
Sr. Member
****
Karma: 12
Posts: 428
Ground.......ground........always ground
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello kcore,
I just found in github (authored 2 days ago) the following Wiznet W5200 library by Jinbuhm Kim with contribution of Fabien Duay with the 32bit code.
Kim works at Wiznet. I haven't checked out. May be is a fresh one or a redundant one.

https://github.com/jbkim/W5200-Arduino-Ethernet-library

It says: Update for supporting Arduino Due.
It also says: Thanks "Matthew Lange".

Regards.




« Last Edit: February 03, 2013, 06:08:23 pm by Palliser » Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 24
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Palliser,

Thanks for the heads up, I tried the code though and it has the same problem as the other code I have tried. 

I guess at this point I'll attempt to reach out to Jinbuhm Kim and see if he has an idea what is going on.  It seems like too many requests to the RX buffer of the W5200 is triggering a condition where it doesn't respond to any more requests.  Since all the TCP/IP stack is contained within the W5200 chip it doesn't seem like this is an Arduino problem per se and may be a bug in the W5200 itself.

WIORE, have you been able to try any of the code? Are you still having the same problem?  If so, we have a documented issue we can go to WIZnet and see if there is a fix or at least get them to acknowledge the problem.
Logged

0
Offline Offline
Newbie
*
Karma: 4
Posts: 42
Arduino rocks - Yeah Baby!!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi,

Thanks for trying my effort at a Ethernet library for Wiznet5200 on Due. The w5200.cpp and w5200.h originally came from Wiznet some time ago and was a modification to the existing 5100 code to setup correct registers etc. I wasnt happy using them to replace the existing Arduino Ethernet code used that as a basis for a complete new library.

Using 8 connections at once may stretching it a bit as I've experienced the odd lockup and sometimes its decided not to work at all but think this might be down to my router. However I have been able to implement a small SD card based webserver that could serve a variety of file formats including html, jpg, gif, png etc so that simple web based management interfaces could be built onto any application running on the Due.

I have found that sometines the webserver sketch wont set the ip address correctly, even though it has been told what it is. As I'd said before, there are still some issues with it, but its a start.

One thing I had thought of, with regarding MAC addresses, is to use the unique code burnt into the SAM chip to form the basis of the MAC address. But not really started looking into this, other than reading the datasheet!

Cheers

Andy
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I hate to revive this thread, but I believe I fixed the refresh problem you were experiencing. I was having similar issues, but with a small modification to the library I resolved it. This is my first post, I was wondering if anyone can direct me to somewhere to note this bug for others?

Cheers,
deception
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 24
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Go ahead and put the information here if you could.

You can use code tags when you reply.  Just click the # button when you make a reply and put the code or lines you changed in between the tags.

Once someone can confirm it has fixed it, mantoui can possibly update his files with the changes.

Thanks!
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I actually posted to the GitHub repositories, so maybe they'll merge the pull requests. Let me know if this resolves your issue!

You can find the fix below.

https://github.com/RyanWaterston/W5200_Arduino_Ethernet_Lib/compare/master...writefix

Cheers,
deception
« Last Edit: November 11, 2013, 11:06:13 pm by deception » Logged

Pages: [1]   Go Up
Jump to: