I am in the process of upgrading a remote monitoring system that used
lwip-1.3.2 to 2.1.2. It all went very well but I am having issues with
some of the options. The application uses the sockets API exclusively.
In lwipopts.h I have the following:
/* Memory options */
#define MEM_LIBC_MALLOC 1
#define MEMP_MEM_MALLOC 1
#define MEMP_MEM_INIT 1
#define MEM_ALIGNMENT 4
#define MEM_SIZE (1024U * 1024U * 3U)
/* Define the padding to align the payload on a 4 byte boundary */
#define ETH_PAD_SIZE 2
The issue I experienced was that the call-back function pointers were
not initialised so the system would randomly crash. I have added a call
memset in the allocator which has fixed the problems. However now the
pbuf memory is zero’d which I see as unnecessary. What is the correct
way to configure lwip to use the c library malloc?.
What is the define which controls the number of sockets that can be open
at one time?