lwip-users
[Top][All Lists]
Advanced

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

[lwip-users] LwIP binary is big...


From: Eduardo Goncalves
Subject: [lwip-users] LwIP binary is big...
Date: Fri, 26 Mar 2021 07:43:13 +0000

Hi

 

I have created a TCP echo server using LwIP raw API running on a STM32F767ZI.

This was based on the example provided by ST in:

en.stm32cubef7_v1-16-0\STM32Cube_FW_F7_V1.16.0\Projects\STM32756G_EVAL\Applications\LwIP\LwIP_TCP_Echo_Server

This example is for the STM32756G but I had it changed to fit the STM32F767ZI.

 

The program is working but the binary is about 55Kbytes, which I find it too large. I have also implemented a FreeRTOS-IP stack with FreeRTOS and I get 40 kbytes!

I’m not using any compiler optimizations because I want to use the debugger properly.

I am interested in using the raw API, so netconn and sockets are disable. I left ping enabled just for test purpose.

 

I just wonder if there is code that can be removed in order to shrink the stack. I guess a optimal size would be around the 40Kbytes.

 

These are my options in lwipopts.h:

 

#define NO_SYS                  1

#define SYS_LIGHTWEIGHT_PROT    0

#define MEM_ALIGNMENT           4

#define MEM_SIZE                (10*1024)

#define MEMP_NUM_PBUF           10

#define MEMP_NUM_UDP_PCB        6

#define MEMP_NUM_TCP_PCB        10

#define MEMP_NUM_TCP_PCB_LISTEN 5

#define MEMP_NUM_TCP_SEG        8

#define MEMP_NUM_SYS_TIMEOUT    10

#define PBUF_POOL_SIZE          8

#define PBUF_POOL_BUFSIZE       1524

#define LWIP_IPV4                1

#define LWIP_TCP                1

#define TCP_TTL                 255

#define TCP_QUEUE_OOSEQ         0

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

#define TCP_SND_BUF             (4*TCP_MSS)

#define TCP_SND_QUEUELEN        (2* TCP_SND_BUF/TCP_MSS)

#define TCP_WND                 (2*TCP_MSS)

#define LWIP_ICMP                       1

#define LWIP_DHCP               0

#define LWIP_UDP                0

#define UDP_TTL                 255

#define LWIP_STATS 0

#define LWIP_NETIF_LINK_CALLBACK        0

#define CHECKSUM_BY_HARDWARE

#define LWIP_NETCONN                    0

#define LWIP_SOCKET                     0

Thanks,

 

Eduardo Goncalves

Control Systems & Digital Solutions

 

Semcon Norge AS

Dyrmyrgata 47

3611 KONGSBERG

Norway

 

E-mail

 

eduardo.goncalves@semcon.com

 

www.semcon.com

 

 

Follow us: LINKEDIN  FACEBOOK  TWITTER  YOUTUBE  INSTAGRAM

 



When you communicate with us or otherwise interact with Semcon, we will process personal data that you provide to us or we collect about you, please read more in our Privacy Policy.

reply via email to

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