Using the following: ------------------------------------------------------------------------------------------------------------------------ #ifndef __LWIPOPTS_H__ #define __LWIPOPTS_H__
#define LWIP_NOASSERT 1 // To suppress some errors for now (no debug output) #define SYS_LIGHTWEIGHT_PROT 1 #define TCPIP_THREAD_PRIO 3 /* ---------- Memory options ---------- */ /* MEM_ALIGNMENT: should be set to the alignment of the CPU for which lwIP is compiled. 4 byte alignment -> define MEM_ALIGNMENT to 4, 2 byte alignment -> define MEM_ALIGNMENT to 2. */ #define MEM_ALIGNMENT 4 /* 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 2000//1000//2000 /* 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 5 /* MEMP_NUM_UDP_PCB: the number of UDP protocol control blocks. One per active UDP "connection". */ #define MEMP_NUM_UDP_PCB 4//4 /* MEMP_NUM_TCP_PCB: the number of simulatenously active TCP connections. */ #define MEMP_NUM_TCP_PCB 2//5 /* MEMP_NUM_TCP_PCB_LISTEN: the number of listening TCP connections. */ #define MEMP_NUM_TCP_PCB_LISTEN 2//4//8 /* MEMP_NUM_TCP_SEG: the number of simultaneously queued TCP segments. */ #define MEMP_NUM_TCP_SEG 8 /* MEMP_NUM_SYS_TIMEOUT: the number of simulateously active timeouts. */ #define MEMP_NUM_SYS_TIMEOUT 5 /* The following four are used only with the sequential API and can be set to 0 if the application only will use the raw API. */ /* MEMP_NUM_NETBUF: the number of struct netbufs. */ #define MEMP_NUM_NETBUF 8 /* MEMP_NUM_NETCONN: the number of struct netconns. */ #define MEMP_NUM_NETCONN 8 /* MEMP_NUM_APIMSG: the number of struct api_msg, used for communication between the TCP/IP stack and the sequential programs. */ #define MEMP_NUM_API_MSG 8//8 /* MEMP_NUM_TCPIPMSG: the number of struct tcpip_msg, which is used for sequential API communication and incoming packets. Used in src/api/tcpip.c. */ #define MEMP_NUM_TCPIP_MSG 8 /* These two control is reclaimer functions should be compiled in. Should always be turned on (1). */ #define MEM_RECLAIM 1 #define MEMP_RECLAIM 1 /* ---------- Pbuf options ---------- */ /* PBUF_POOL_SIZE: the number of buffers in the pbuf pool. */ #define PBUF_POOL_SIZE 4//10//4 /* PBUF_POOL_BUFSIZE: the size of each pbuf in the pbuf pool. */ #define PBUF_POOL_BUFSIZE 512//512//1500 /* PBUF_LINK_HLEN: the number of bytes that should be allocated for a link level header. */ #define PBUF_LINK_HLEN 16 /* ---------- 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 1 /* TCP Maximum segment size. */ #define TCP_MSS 1500 /* TCP sender buffer space (bytes). */ #define TCP_SND_BUF 1500 /* TCP sender buffer space (pbufs). This must be at least = 2 * TCP_SND_BUF/TCP_MSS for things to work. */ #define TCP_SND_QUEUELEN 6 * TCP_SND_BUF/TCP_MSS /* TCP receive window. */ #define TCP_WND 1500 /* Maximum number of retransmissions of data segments. */ #define TCP_MAXRTX 12 /* Maximum number of retransmissions of SYN segments. */ #define TCP_SYNMAXRTX 4 /* ---------- ARP options ---------- */ #define ARP_TABLE_SIZE 10 #define ARP_QUEUEING 1 /* ---------- IP options ---------- */ /* Define IP_FORWARD to 1 if you wish to have the ability to forward IP packets across network interfaces. If you are going to run lwIP on a device with only one network interface, define this to 0. */ #define IP_FORWARD 1 /* If defined to 1, IP options are allowed (but not parsed). If defined to 0, all packets with IP options are dropped. */ #define IP_OPTIONS 1 /* ---------- ICMP options ---------- */ #define ICMP_TTL 255 /* ---------- DHCP options ---------- */ /* Define LWIP_DHCP to 1 if you want DHCP configuration of interfaces. DHCP is not implemented in lwIP 0.5.1, however, so turning this on does currently not work. */ #define LWIP_DHCP 0 /* 1 if you want to do an ARP check on the offered address (recommended). */ #define DHCP_DOES_ARP_CHECK 1 /* ---------- UDP options ---------- */ #define LWIP_UDP 1 #define UDP_TTL 255 /* ---------- Statistics options ---------- */ #define STATS #ifdef STATS #define LINK_STATS 1 #define IP_STATS 1 #define ICMP_STATS 1 #define UDP_STATS 1 #define TCP_STATS 1 #define MEM_STATS 1 #define MEMP_STATS 1 #define PBUF_STATS 1 #define SYS_STATS 1 #endif /* STATS */ #define LWIP_PROVIDE_ERRNO 0 #define IP_REASSEMBLY 0 #define IP_FRAG 0 #endif /* __LWIPOPTS_H__ */ --------------------------------------------------------------------------------------------------------------------- the biggest variables for lwip are: ram: 2012 byte memp_memory: 1924 byte pbuf_pool_memory: 2116 byte bye, Piero 2007/11/25, Frédéric BERNON <[EMAIL PROTECTED]>: > > You can also post here you lwipopts.h, but lot of options have changed > since 1.1.0. > > ----- Original Message ----- > *From:* Frédéric BERNON <[EMAIL PROTECTED]> > *To:* Mailing list for lwIP users <[email protected]> > *Sent:* Sunday, November 25, 2007 8:05 PM > *Subject:* Re: [lwip-users] NOANSWERS?????: LWIP - memory > usageconfiguration-HELPME!! > > >have i wait a 1.3.0 version? or get cvs version (beta?)? or use 1.2.0? > > Even if there is a date, I hope 1.3.0 will be released before the end of > the year. Else, you can get the last CVS HEAD. > > First, which features do you need ? Do you have disable most of options > you don't use? > > > ----- Original Message ----- > *From:* Piero 74 <[EMAIL PROTECTED]> > *To:* Mailing list for lwIP users <[email protected]> > *Sent:* Sunday, November 25, 2007 8:01 PM > *Subject:* Re: [lwip-users] NOANSWERS?????: LWIP - memory usage > configuration-HELPME!! > > i found in init.c file in current CVS some options deprecated: > > now i'm linking the 1.2.0 version... i didn't have this file.... > > have i wait a 1.3.0 version? or get cvs version (beta?)? or use 1.2.0? > > and... please someone tell me something about other issues in my email. > > Thanks Frédéric! > > 2007/11/25, Frédéric BERNON <[EMAIL PROTECTED]>: > > > > There is some indications in init.c , in the last CVS HEAD. Take a look > > on lwip_sanity_check and on previous preprocessor checkings. > > > > > > ----- Original Message ----- > > *From:* Piero 74 <[EMAIL PROTECTED]> > > *To:* [email protected] > > *Sent:* Sunday, November 25, 2007 7:30 PM > > *Subject:* [lwip-users] NOANSWERS?????: LWIP - memory usage > > configuration -HELPME!! > > > > please anyone help me!!!! > > > > :O( > > > > > > 2007/11/23, Piero 74 <[EMAIL PROTECTED]>: > > > > > > Hi all. > > > > > > Can someone help me to understand options in opt.h (LWIPopt.h) which > > > change memory usage? > > > > > > what are limits for each option? (for example NOT LESS THAN...) > > > How each option is connected to others? (for example: options for > > > sequential API and options for tcp and udp connections... ) > > > can i change pbuf options? (PBUF_POOL_BUFSIZE..... ) > > > > > > in particular, i want to understand how reduce the following > > > variables: > > > - ram > > > - memp_memory > > > - pbuf_pool_memory > > > > > > depending on number of simultanely connections (TCP, TCP LISTENER, > > > UDP) (i have to use socket for apllication porting reasons) > > > > > > > > > Correct me if i'm wrong: > > > > > > the total memory depends on 3 things: > > > > > > - memory for low level driver, where MAC layer puts ethernet frames > > > - memory for LWIP (the above discussion) > > > - memory for application task, which use sequential API and needs a > > > owner buffers > > > > > > is it true? > > > > > > PLEASE HELP ME! > > > i'm working on an example which use: > > > - LWIP (1.1.1.. but i will update to 1.2.0) (ported from GNU to IAR) > > > - FRERTOS FOR ARM7 (lpc2368 microcontroller) > > > - lpc2368 EMAC driver > > > > > > i'm having a lot of problem, and i have to reduce memory usage... > > > and at the last (....) i have to understand how to use lwip!!! > > > > > > Bye, > > > Piero > > > > > > > > > > > ------------------------------ > > > > _______________________________________________ > > lwip-users mailing list > > [email protected] > > http://lists.nongnu.org/mailman/listinfo/lwip-users > > > > > > _______________________________________________ > > lwip-users mailing list > > [email protected] > > http://lists.nongnu.org/mailman/listinfo/lwip-users > > > > ------------------------------ > > _______________________________________________ > lwip-users mailing list > [email protected] > http://lists.nongnu.org/mailman/listinfo/lwip-users > > ------------------------------ > > _______________________________________________ > lwip-users mailing list > [email protected] > http://lists.nongnu.org/mailman/listinfo/lwip-users > > > _______________________________________________ > lwip-users mailing list > [email protected] > http://lists.nongnu.org/mailman/listinfo/lwip-users >
_______________________________________________ lwip-users mailing list [email protected] http://lists.nongnu.org/mailman/listinfo/lwip-users
