This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Reducing LwIP size



Hello,  in our examples we are using LwIP to communicate via UDP/TCP sockets (no webservers) to the world.

We are using in lwipopts.h a PBUF_POOL_BUFSIZE of 1500 bytes, since we aare using that kind of packets.

However, the RAM size of using LWIP is pretty big for what it does. So if we compare the map files of the same program, with and without LWIP enabled we get:

As a detail:

As you can see, the difference is about 143kBs of SRAM, more than half of the SRAM size!!

Reading about lwip on google, a recommended action is to define:

#define MEM_LIBC_MALLOC 1
#define MEMP_MEM_MALLOC 1

to make lwip to use the C runtime memory functions (malloc, free, etc.) and disable the memp-pool code and use the heap instead.

However, if we use those defines, we can only see a first ARP packet from the Tiva device and it won't answer to anything else.

Does TI recommend another workaround to reduce the lwip footprint?

Any other try from the community?

Thank you all.

  • Ok, one good approach has been to define MEM_SIZE as (18 * 1024) and use only:
    #define MEMP_MEM_MALLOC 1
    and remove the MEM_LIBC_MALLOC define.

    That frees up to 000213b2 of SRAM.

    But of course, would love to hear more brilliat ideas!!!