Currently implementing LWiP (2.2.0) into system alongside FreeRTOS(V10.2.1).
Now LWiP states that "“confidSUPPORT_DYNAMIC_ALLOCATION” must be asserted when using LWIP with FreeRTOS.
I am using custom memory pools.
Issue is, when dynamic allocation is enabled, in timers.c, in the function prvProcessReceivedCommands, VPortFree(pxTimer); is called for tmrCOMMAND_DELETE case.
I am getting an undefined reference to ‘vPortFree’.
The function is declared in portable.h. but I have no portable.c or any actual function for vPortFree.
I cant see anywhere where LWIP calls for this process, but its something i cant get rid of.
Any suggestions?
With configSUPPORT_DYNAMIC_ALLOCATION enabled pvPortMalloc/vPortFree have to be implemented accordingly. Either by using one of the FreeRTOS provided memory managers or by your pool implementation.
If your pools are thread safe you could just
When you set configSUPPORT_DYNAMIC_ALLOCATION to 1, you need to have pvPortMalloc and vPortFree functions. Do you not see undefined symbol error for pvPortMalloc? If so, can you check where is it coming from?
So this is what is confusing me.
I am using pools, so is dynamic allocation still required, i.e. using the heap?
I think me issue is, my FreeRTOS heap setting is for static allocation only. Would i need to change my heap type for FreeRTOS to allow for dynamic allocation within my pools?
It appears that there is no pvPortMalloc either.
in FreeRTOSConfig.h, I have #define pvPortMalloc poolAlloc and #define vPortFree poolFree, where should i create the poolFree and poolAlloc functions?
poolAlloc/Free were just placeholders for YOUR pool allocation/free functions if you just want to / can replace FreeRTOS heap functions with your pool functions.
Pools (could) also provide dynamic allocation API.
If this is not the case for your pool implementation you could ADD a suitable FreeRTOS memory manager providing standard allocation API if required.
Can you elaborate on what you mean by using pools? Can you share the API of your pool?
What is the value of configSUPPORT_DYNAMIC_ALLOCATION in your FreeRTOSConfig.h? If it is 1, then you are NOT using static only and you need pvPortMalloc and vPortFree.
And you not getting missing symbol error for that? Can you share your map file? Is it possible for you to share your complete code?