AnsweredAssumed Answered

LWIP stack memory configuration

Question asked by Tommy on Jul 13, 2010
Latest reply on Jul 20, 2010 by Tommy

Hi ADI Support,


I am using BF561 with an LAN9218 Network device IC. This is the application that comes with the Avnet Camera eval board. For this I have adapted the LAN9218 driver from BF548 to the BF561 Camera board with DMA support. Everything works fine and I can run some TCP/UPD connections and also e.g. the webserver but except when I produce a lot of traffic on the network with smaller packages. E.g. when I produce a lot of small UDP or TCP/IP packages with sizes e.g. 2 Bytes, 4 Bytes etc. after a while the LW TCP/IP stack hangs up. I have also downloaded the latest LWIP stack and compiled this for the BF561 target with same result. Than I have notices that it makes a huge difference when I use Cache with WriteThrough and WriteBack option. With WriteBack option it seems to work without the hang up.


What is your suggestion about the memory which is provided to the lwip stack. Should this be inside a cached memory block? Any Explanation for this behaviour? I have also allocated 2 MByte for the stack which is recommended. Are there also any requirments for the VDK LWIP Thread and for the stack size?


#define ETHER_STACK_SIZE_NEW    1024*1024*2


char* ether_stack_block = (char *) malloc ( ETHER_STACK_SIZE);

init_stack ( 3, 1, ETHER_STACK_SIZE, ether_stack_block );