lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] Understanding memory configuration


From: Andy Pont
Subject: Re: [lwip-users] Understanding memory configuration
Date: Tue, 18 Sep 2018 07:53:47 +0000
User-agent: eM_Client/7.2.33106.0

Simon wrote...

Yes. Just follow the defines:

LWIP_MALLOC_MEMPOOL() -> LWIP_MEMPOOL() -> LWIP_MEMPOOL_DECLARE() -> memp.h lint 95 (git head) instantiates the memory via LWIP_DECLARE_MEMORY_ALIGNED()
The plot thickens…

I tried to follow this code but couldn’t find some of the defines.  It turns out this project hasn’t been updated and is still running v1.4.x code!  Looking through the .map file from the linker there is a memp_memory in the .bss section which is 23,291 bytes.

Looking through the code, I did discover that the memp_std.h header file doesn’t pickup the values defined in lwipopts.h as the MEMP_USE_CUSTOM_POOLS part isn’t being used and therefore lwippools.h isn’t being included.

It appears that the multiple definitions using LWIP_MEMPOOL() and LWIP_PBUF_MEMPOOL() in memp_std.h are being used.  Swapping in the constants from the options file these become:

LWIP_MEMPOOL(TCPIP_MSG_API,    3,   sizeof(struct tcpip_msg),      "TCPIP_MSG_API”)
LWIP_MEMPOOL(TCPIP_MSG_INPKT, 18,   sizeof(struct tcpip_msg),      "TCPIP_MSG_INPKT”)
LWIP_MEMPOOL(SYS_TIMEOUT,      5,   sizeof(struct sys_timeo),      "SYS_TIMEOUT”)
LWIP_PBUF_MEMPOOL(PBUF,       20,                          0,      "PBUF_REF/ROM”)
LWIP_PBUF_MEMPOOL(PBUF_POOL,  23,                        385,      "PBUF_POOL")

I’ve tried to do some calculations based on the various structure sizes but don’t ever seem to get anywhere near the 23,291 bytes!

-Andy.


reply via email to

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