1. Reduce the size of the heap memory 2. Change the TCP segment size 3. Disable UDP + DHCP + DNS 4. Change the configuration of the TCP/IP thread
Fork of lwip by
Diff: lwipopts.h
- Revision:
- 15:5737291d43a8
- Parent:
- 12:931deec14b08
- Child:
- 16:f159c25d9261
--- a/lwipopts.h Tue Sep 10 15:14:39 2013 +0300 +++ b/lwipopts.h Sun Feb 02 10:46:40 2014 +0000 @@ -37,10 +37,12 @@ #define DEFAULT_RAW_RECVMBOX_SIZE 8 #define DEFAULT_ACCEPTMBOX_SIZE 8 -#define TCPIP_THREAD_STACKSIZE 1024 +//#define TCPIP_THREAD_STACKSIZE 1024 +#define TCPIP_THREAD_STACKSIZE 512 #define TCPIP_THREAD_PRIO (osPriorityNormal) -#define DEFAULT_THREAD_STACKSIZE 512 +//#define DEFAULT_THREAD_STACKSIZE 512 +#define DEFAULT_THREAD_STACKSIZE 300 #define MEMP_NUM_SYS_TIMEOUT 16 #endif @@ -48,23 +50,29 @@ // 32-bit alignment #define MEM_ALIGNMENT 4 -#define MEM_SIZE 16362 +//#define MEM_SIZE 16362 +#define MEM_SIZE (8 * 1024) #define PBUF_POOL_SIZE 5 -#define MEMP_NUM_TCP_PCB_LISTEN 4 -#define MEMP_NUM_TCP_PCB 4 -#define MEMP_NUM_PBUF 8 +//#define PBUF_POOL_SIZE 16 +#define MEMP_NUM_TCP_PCB_LISTEN 2 +#define MEMP_NUM_TCP_PCB 1 +//#define MEMP_NUM_PBUF 8 +#define MEMP_NUM_PBUF 5 #define TCP_QUEUE_OOSEQ 0 #define TCP_OVERSIZE 0 -#define LWIP_DHCP 1 -#define LWIP_DNS 1 +//#define LWIP_DHCP 1 +//#define LWIP_DNS 1 +#define LWIP_DHCP 0 +#define LWIP_DNS 0 // Support Multicast -#include "stdlib.h" -#define LWIP_IGMP 1 -#define LWIP_RAND() rand() +//#include "stdlib.h" +//#define LWIP_IGMP 1 +#define LWIP_IGMP 0 +//#define LWIP_RAND() rand() #define LWIP_COMPAT_SOCKETS 0 #define LWIP_POSIX_SOCKETS_IO_NAMES 0 @@ -110,10 +118,14 @@ #if LWIP_TRANSPORT_ETHERNET /* MSS should match the hardware packet size */ -#define TCP_MSS 1460 +//#define TCP_MSS 1460 +#define TCP_MSS 560 #define TCP_SND_BUF (2 * TCP_MSS) #define TCP_WND (2 * TCP_MSS) +//#define TCP_SND_BUF (4 * TCP_MSS) +//#define TCP_WND 4096 #define TCP_SND_QUEUELEN (2 * TCP_SND_BUF/TCP_MSS) +//#define TCP_SND_QUEUELEN ((4 * (TCP_SND_BUF) + (TCP_MSS - 1))/(TCP_MSS)) // Broadcast #define IP_SOF_BROADCAST 1