|Subject:||Re: [lwip-users] Understanding memory configuration|
|Date:||Tue, 18 Sep 2018 07:53:47 +0000|
The plot thickens…Yes. Just follow the defines:
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!
|[Prev in Thread]||Current Thread||[Next in Thread]|