I failed to create 5 UDP connection when using LWIP, id i reduce onw, all works ok, is there a limit on number of UDPs I cam use?
Regards!
Ping
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.
I failed to create 5 UDP connection when using LWIP, id i reduce onw, all works ok, is there a limit on number of UDPs I cam use?
Regards!
Ping
Hello Ping,
It looks like this limitation comes from the default declaration of UDP control blocks. This is defined inside of the following file located in TivaWare: [Install Path]/third_party/lwip-1.4.1/src/include/lwip/opt.h. From my understanding, this value can be modified in the "lwipopts.h" file of the project to expand the capability at a project specific level.
/**
* MEMP_NUM_UDP_PCB: the number of UDP protocol control blocks. One
* per active UDP "connection".
* (requires the LWIP_UDP option)
*/
#ifndef MEMP_NUM_UDP_PCB
#define MEMP_NUM_UDP_PCB 4
#endif
Check your lwipopts.h file, around line 95, for #define MEM_NUM_UDP_PCB.
It defaults to 4. Change it as needed.
//***************************************************************************** // // ---------- Internal Memory Pool Sizes ---------- // //***************************************************************************** #define MEMP_NUM_PBUF 48 // Default 16 //#define MEMP_NUM_RAW_PCB 4 //#define MEMP_NUM_UDP_PCB 4 // THIS ONE! #define MEMP_NUM_TCP_PCB 16 // Default 5 //#define MEMP_NUM_TCP_PCB_LISTEN 8 #define MEMP_NUM_TCP_SEG 32 // Default 16 //#define MEMP_NUM_REASSDATA 5 //#define MEMP_NUM_ARP_QUEUE 30 //#define MEMP_NUM_IGMP_GROUP 8 #define MEMP_NUM_SYS_TIMEOUT 8 //#define MEMP_NUM_NETBUF 2 //#define MEMP_NUM_NETCONN 4 //#define MEMP_NUM_TCPIP_MSG_API 8 //#define MEMP_NUM_TCPIP_MSG_INPKT 8 #define PBUF_POOL_SIZE 48 // Default 16