Skip to content

LWIP: make MEMP_NUM_NETBUF and MEMP_NUM_PBUF configurable #11681

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

Closed
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
10 changes: 10 additions & 0 deletions features/lwipstack/lwipopts.h
Original file line number Diff line number Diff line change
Expand Up @@ -226,14 +226,24 @@

// Number of non-pool pbufs.
// Each requires 92 bytes of RAM.
#ifdef MBED_CONF_LWIP_PBUF_NUM
#undef MEMP_NUM_PBUF
#define MEMP_NUM_PBUF MBED_CONF_LWIP_PBUF_NUM
#else
#ifndef MEMP_NUM_PBUF
#define MEMP_NUM_PBUF 8
#endif
#endif

// Each netbuf requires 64 bytes of RAM.
#ifdef MBED_CONF_LWIP_NETBUF_NUM
#undef MEMP_NUM_NETBUF
#define MEMP_NUM_NETBUF MBED_CONF_LWIP_NETBUF_NUM
#else
#ifndef MEMP_NUM_NETBUF
#define MEMP_NUM_NETBUF 8
#endif
#endif

// One netconn is needed for each UDPSocket, TCPSocket or TCPServer.
// Each requires 236 bytes of RAM (total rounded to multiple of 512).
Expand Down
8 changes: 8 additions & 0 deletions features/lwipstack/mbed_lib.json
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,14 @@
"ppp-thread-stacksize": {
"help": "Thread stack size for PPP (obsolete: use netsocket/ppp configuration instead)",
"value": 768
},
"pbuf-num": {
"help": "Number of pbufs in MEMP_PBUF pool",
"value": null
},
"netbuf-num": {
"help": "Number of netbufs in MEMP_NETBUF pool",
"value": null
}
},
"target_overrides": {
Expand Down