FAQ: Increasing the maximum number of sockets in the lwIP Add-In for CrossCore Embedded Studio

Document created by CraigG on Nov 12, 2013Last modified by CraigG on Nov 12, 2013
Version 3Show Document
  • View in full screen mode


I cannot open more than 8 UDP sockets in lwIP. Is this a limitation of the lwIP stack; can it be modified?





The pre-built lwIP libraries provided in the lwIP Add-In for CrossCore Embedded Studio have a number of options that have been configured to default values that will be suitable for a wide number of applications, however there will be cases where they are not appropriate - such as requiring a greater number of UDP sockets.


Within the lwIP Add-In for CrossCore Embedded Studio we provide the full lwIP source code, together with projects for rebuilding the libraries. These can be found at "C:\Analog Devices\lwIP_Stack-Rel1.0.1\lwip\Blackfin\lib\lwip\contrib\ports\blackfin\projects\".


Most lwIP options are configured through the "lwipopts.h" file, which can be found at "C:\Analog Devices\lwIP_Stack-Rel1.0.1\lwip\Blackfin\lib\lwip\contrib\ports\blackfin\config\". We provide three different example configurations - lwipopts.h (default), lwipopts_big.h (provides increased memory to the lwIP stack), and lwipopts_small.h (which provides a smaller lwIP footprint). To use one of these other presets, simply change the name of the exsiting lwipopts.h file (e.g. to "lwipopts.h.bak"), and rename one of the other lwipopts_*.h files to "lwipopts.h". Alternatively, you can simply edit the lwipopts. file - though we would recommend making a backup of this file first.


After editing any of these settings, rebuild the library. A post-build command will take care of copying the newly-built library into the "C:\Analog Devices\lwIP_Stack-Rel1.0.1\lwip\Blackfin\lib\..." directory, so it will be linked by default for all lwIP applications.