[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lwip-users] webserver problem

From: Noam weissman
Subject: Re: [lwip-users] webserver problem
Date: Tue, 9 Jul 2013 14:33:30 +0300


As default the MSS size is defined to be 1500 bytes. This is too large for 

Try to reduce it to 536 and increase the total number of PCBS.

These are my settings:

/* MEM_SIZE: the size of the heap memory. If the application will send
a lot of data that needs to be copied, this should be set high. */
#define MEM_SIZE                (10*1024) //(7*1024)

/* MEMP_NUM_PBUF: the number of memp struct pbufs. If the application
   sends a lot of data out of ROM (or other static memory), this
   should be set high. */
#define MEMP_NUM_PBUF           100
/* MEMP_NUM_UDP_PCB: the number of UDP protocol control blocks. One
   per active UDP "connection". */
#define MEMP_NUM_UDP_PCB        10
/* MEMP_NUM_TCP_PCB: the number of simulatenously active TCP
   connections. */
#define MEMP_NUM_TCP_PCB        12
/* MEMP_NUM_TCP_PCB_LISTEN: the number of listening TCP
   connections. */

/* MEMP_NUM_SYS_TIMEOUT: the number of simulateously active
   timeouts. */
#define MEMP_NUM_SYS_TIMEOUT    10

/* ---------- Pbuf options ---------- */
/* PBUF_POOL_SIZE: the number of buffers in the pbuf pool. */
#define PBUF_POOL_SIZE          20

/* PBUF_POOL_BUFSIZE: the size of each pbuf in the pbuf pool. */
#define PBUF_POOL_BUFSIZE       600

/* ---------- TCP options ---------- */
#define LWIP_TCP                1
#define TCP_TTL                 255

/* Controls if TCP should queue segments that arrive out of
   order. Define to 0 if your device is low on memory. */
#define TCP_QUEUE_OOSEQ         0

/* TCP Maximum segment size. */
//#define TCP_MSS                 (1500 - 40)     /* TCP_MSS = (Ethernet MTU - 
IP header size - TCP header size) */
#define TCP_MSS                 536

/* TCP sender buffer space (bytes). */
//#define TCP_SND_BUF             (2*TCP_MSS)
#define TCP_SND_BUF             (8*TCP_MSS)

/*  TCP_SND_QUEUELEN: TCP sender buffer space (pbufs). This must be at least
  as much as (2 * TCP_SND_BUF/TCP_MSS) for things to work. */

//#define TCP_SND_QUEUELEN        (2* TCP_SND_BUF/TCP_MSS)
#define TCP_SND_QUEUELEN        (4 * (TCP_SND_BUF)/(TCP_MSS))
/* TCP receive window. */
//#define TCP_WND                 (2*TCP_MSS)
#define TCP_WND                 (4*TCP_MSS)

/* MEMP_NUM_TCP_SEG: the number of simultaneously queued TCP
   segments. */
//#define MEMP_NUM_TCP_SEG        20
#define MEMP_NUM_TCP_SEG        TCP_SND_QUEUELEN // 20  // This was previosly 
20 and cause a MEM_ERR it was changed 
                                                 // to BE THE SAME SIZE AS 


-----Original Message-----
From: address@hidden [mailto:address@hidden On Behalf Of Nikolas Karakotas
Sent: ג 09 יולי 2013 11:16
To: Mailing list for lwIP users
Subject: Re: [lwip-users] webserver problem


Try and increase your MEM_SIZE.


-----Original Message-----
From: pcu
Sent: Monday, July 08, 2013 6:11 PM
To: address@hidden
Subject: [lwip-users] webserver problem

I work with STM32F217 + LWIP 1.3.2 + FreeRTOS 6.1.0

I have several services in parallel:
One webserver (therefore on TCP)
One UDP client to connect NTP.
One UDP client ECHO request.
One UDP server listening broadcast messages.

The webserver is heavy, because pages are in javascript and need Jquery 
Neverthless, So far so good.

But If I connect other services, all the pages from webserver are not loaded.
I tried to increase some parameters but without success. I don't know where to 
go to improve the webserver.

This is the screenshot from Chrome:

Good, with all UDP services disabled:

Note that I updated the ethernefif.c like this:

Thank you for your help,

View this message in context: 
Sent from the lwip-users mailing list archive at Nabble.com.

lwip-users mailing list

lwip-users mailing list

This footnote confirms that this email message has been scanned by PineApp 
Mail-SeCure for the presence of malicious code, vandals & computer viruses.

This footnote confirms that this email message has been scanned by
PineApp Mail-SeCure for the presence of malicious code, vandals & computer 

reply via email to

[Prev in Thread] Current Thread [Next in Thread]