Skip to content

lwIP: Add memory configs to JSON #5250

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 13, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion features/FEATURE_LWIP/lwip-interface/lwipopts.h
Original file line number Diff line number Diff line change
Expand Up @@ -137,10 +137,25 @@
#define LWIP_RAM_HEAP_POINTER lwip_ram_heap

// Number of pool pbufs.
// Each requires 684 bytes of RAM.
// Each requires 684 bytes of RAM (if MSS=536 and PBUF_POOL_BUFSIZE defaulting to be based on MSS)
#ifdef MBED_CONF_LWIP_PBUF_POOL_SIZE
#undef PBUF_POOL_SIZE
#define PBUF_POOL_SIZE MBED_CONF_LWIP_PBUF_POOL_SIZE
#else
#ifndef PBUF_POOL_SIZE
#define PBUF_POOL_SIZE 5
#endif
#endif

#ifdef MBED_CONF_LWIP_PBUF_POOL_BUFSIZE
#undef PBUF_POOL_BUFSIZE
#define PBUF_POOL_BUFSIZE MBED_CONF_LWIP_PBUF_POOL_BUFSIZE
#endif

#ifdef MBED_CONF_LWIP_MEM_SIZE
#undef MEM_SIZE
#define MEM_SIZE MBED_CONF_LWIP_MEM_SIZE
#endif

// One tcp_pcb_listen is needed for each TCPServer.
// Each requires 72 bytes of RAM.
Expand Down
12 changes: 12 additions & 0 deletions features/FEATURE_LWIP/lwip-interface/mbed_lib.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,18 @@
"help": "Maximum number of open UDPSocket instances allowed, including one used internally for DNS. Each requires 84 bytes of pre-allocated RAM",
"value": 4
},
"pbuf-pool-size": {
"help": "Number of pbufs in pool - usually used for received packets, so this determines how much data can be buffered between reception and the application reading. If a driver uses PBUF_RAM for reception, less pool may be needed. Current default (used if null here) is set to 5 in lwipopts.h, unless overridden by target Ethernet drivers.",
"value": null
},
"pbuf-pool-bufsize": {
"help": "Size of pbufs in pool. If set to null, lwIP will base the size on the TCP MSS, which is 536 unless overridden by the target",
"value": null
},
"mem-size": {
"help": "Size of heap (bytes) - used for outgoing packets, and also used by some drivers for reception. Current default (used if null here) is set to 1600 in opt.h, unless overridden by target Ethernet drivers.",
"value": null
},
"tcpip-thread-stacksize": {
"help": "Stack size for lwip TCPIP thread",
"value": 1200
Expand Down