LPCOpen LWIP webserver dies

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

LPCOpen LWIP webserver dies

1,810 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by djlegge on Mon Feb 24 10:45:54 MST 2014
Hi.
I downloaded lpcopen_2_07_lpcxpresso_nxp_lpcxpresso_1769.zip and built the lwip_tcpecho_freertos demo. It works fine.
Next, I added httpserver_raw from the lwip-contrib git repo. This was pretty easy to get built as part of the project.
I now call httpd_init() in vSetupIFTask(). I had to #define LPC_TX_PBUF_BOUNCE_EN as 1 in lwipopts.h otherwise I got the error LWIP_ASSERT("lpc_low_level_output: Not a DMA safe pbuf").
With the addition of #define LWIP_RAW as 1 in lwipopts.h, the basic web server builds and runs.
The web server shows one static (default) page and will cope with about 10 refreshes of this page but then starts to 'go slow' and eventually stops responding all together.
When this happens, ping does not respond, and nor does the tcpecho running on port 7.
LWIP does seem to still be running however. I've enabled the LWIP_DEBUG, HTTPD_DEBUG and LWIP_STATS and can't see anything obviously wrong except for dropped packets in the link_stats. This will show zero while the refreshes are working.
When I added some further pages with dynamic content (SSI's) then the webserver became unusable very quickly and appeared to run out of memory. I am not sure it this is related but I suspect it is...
I currently use the UIP (not LWIP) webserver successfully with FreeRTOS on an LPC1768 but we are planning to add some other services such as modbusTCP and I am not sure UIP will be up to the task (or at least will be awkward).
Does anybody have any ideas as to what might be going on ?
Thanks.
0 Kudos
Reply
6 Replies

1,435 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by sonne123 on Thu Aug 14 03:13:34 MST 2014
OK, thanks very much for answering.
0 Kudos
Reply

1,435 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by djlegge on Wed Aug 13 02:30:23 MST 2014
Hi sonne123.

No, sorry I haven't worked on this project since and UIP is working for me at the moment until we need to add more complexity later. AT that point we'll probably try LWIP again.

Best regards.
0 Kudos
Reply

1,435 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by sonne123 on Thu Aug 07 02:50:00 MST 2014
Hi,

I am experiencing same problems here at my end. Modifying lwip settings could not get sufficient, reproducable results. Sometimes it works smoothly for more than one hour while retrieving websites, but same firmware would would just hang in different network configurations or after rebooting my windows machine. Seems like a random behaviour, maybe timing driven.

Did you guys find some improvements here that you may want to share?

Best Regards
0 Kudos
Reply

1,435 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by medake on Tue Apr 29 04:55:16 MST 2014
Hello Darren,

Thanks for the reply.

I was previously using LPCOpen version 2.7 and this release has non-RTOS webserver example.
I modified 'lwip_tcpecho_freertos' from this release and removed tcpecho and added a
httpd (webserver) thread into it. LWIP started hanging at around 50 page hits.

Now as you suggested I tried LPCOpen version 2.10. This release has FreeRTOS based
webserver example. But i got same result and LWIP stopped responding after 80 page hit counts.

I have another project  LWIP + FreeRTOS in Keil that works perfectly fine for my webserver application.
It doesn't hang even I ping continuously. May be Keil is playing a trick here. So time being I am going to
migrate my application to Keil. But it is very disappointing that I cannot use LPCXpresso and GCC.

I will keep on putting offline efforts to resolve this.

Best Regards,
Mangesh Edake



0 Kudos
Reply

1,435 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by djlegge on Mon Apr 28 04:47:26 MST 2014
Hello Medake

I ran out of time to mess with it and have settled on UIP for now. I don't need to incorporate modbusTCP for a few months so will evaluate LWIP for this later.

I did recently try the 'webserver_freertos' example from LPCOpen version 2.10 from here :
http://www.lpcware.com/content/nxpfile/lpcopen-software-development-platform-lpc17xx-packages

This seems to work fine so it looks like the problem is fixed. Have you tried that ?

I would say that LWIP does use MUCH more ram than UIP.....so if you have a large ram requirement for other things (USB host in my case) UIP may still be a good choice.

Good luck with modbusTCP. It should be quite easy with LWIP (hopefully).

Darren

0 Kudos
Reply

1,435 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by medake on Mon Apr 28 03:32:52 MST 2014
Hello djlegge,

I am trying the same thing on LPC1788 with LPCXpresso v6.1.4_194.
For webserver + LWIP + FreeRTOS, I am getting exactly same results like you.
I am also planning to add modbusTCP and *NOT* willing to use uIP like you.

Will you please let me know how did you manage all above..?

I will appreciate your helpful suggestions and guidelines.

Best Regards,
Mangesh Edake
0 Kudos
Reply