2007-01-23 11:07 AM
2011-05-17 12:31 AM
Has anyone experiences in programming the ethernet interface using the uip stack?
greeni2011-05-17 12:31 AM
I did....
Be carefull. the sources I found of µIP had a somme problems. If you want to use UDP connection, you must modify the uip.h and add somme pragma to pack data structures. in IAR it is #pragma pack(push, 1) // at begin of the file and #pragma pack(pop) in Keil you must add the __packed at each structures declaration An other problem was : By default the uip_appdata is too small to copy a full ehernet frame you mout extend it I did not have other problems Regards2011-05-17 12:31 AM
Have you ported the str websever example with uip to keil?
I tried, but with the str startup file keil can´t compile. But when i use the keil startup code, keil compiles the files but the webserver don´t runs. do you have an example project for keil with uip? greeni2011-05-17 12:31 AM
Here his a very simple web server sample for Keil 3.02 using µIP
Please note that the orignal source was writen for IAR and I use the samme start up code (modified) instaid of the Keil startup.2011-05-17 12:31 AM
Hi Guys,
Most of the examples I found knocking around were based around 0.9 of the uIP, not 1.0, so I decided to do a new port. A few things found on my travels: 1. The implementation of the timer routine that uIP needs (use by ARP etc.) didn't work properly in most examples and result caused connections to get cleared out too quickly, or the timer poll to UIP was thrashing the system. 2. The ENET driver supplied with the HAL only has a 1 deep DMA rx buffer and it's also polled by the app. This can result in two packets that get received in a short period of time to get corrupted. The knock on affect is your browser waiting for about 6 seconds before it re-tries. I ended up writing my own one based on a combination of the Keil ENET driver and a few principles from the ST one. 3. The throughput on uIP is really bad out of the box (limited to about 6KBytes/Sec). This is because it can only process one packet at a time and Windows implements delay Acks. The delay ack means that it will only ack a packet if 200ms has passed, or it's received another similar segment packet from the server. This means those 200ms soon add up and hence 1.5K * 5 = approx 6K/Sec... far lower rates if sent tcpip packets are not full. The Keil HTTP server demo that uses their IP stack doesn't have this problem, but you have to pay good $$$$ for that! 4. A few byte packing issues on structures. 5. For good performance I rewrote the CRC and 32 bit routines to be 32bit ARM native. 6. Proto-threads as used by the uIP http demo is a complete nightmare to debug. On the surface a cool concept, in practise it's virtually impossible to trace through. After lots of hard work I've now got the uIP webpages appearing virtually instantly, rather than not displaying for about 5-10seconds (as seen on the dynamically generated script based ones). If I was doing this again I would actually consider buying the Keil IP stack, as I must of spent a few thousand dollars worth in time getting uIP and Ethernet drivers working properly. Sorry, can't post any example code, don't think the company I work for would be too happy giving away work for free!2011-05-17 12:31 AM
Stevesky,
So were you able to get the 1.0 webserver with protothreads to work in Keil uVision 3? I am having issues with it (as you say, a real nightmare to debug!!). My code compiles fine but my MC will not execute instructions, it is just hung. After selective compiling, I am pretty sure there is a problem with the psock_generator_send() proto thread and the way that it generically calls functions. Does this sound familiar to your experiences? Any chance you could help me out or give me a few pointers on what to look for? Thanks! Eric