lpcware

lwIP

Discussion created by lpcware Employee on Jun 15, 2016
Content originally posted in LPCWare by alpha on Sun Jun 10 21:20:13 MST 2012
Hi I'm new to lwIP and I need some help in understanding how it works.

1) Where is the buffer for the raw TCP data? Is the buffer of the raw TCP data same as the buffer after stripping of the TCP headers? Are they using the same buffer?

I found this on lpc17xx_emac.c

00079 static uint32_t rx_buf[EMAC_NUM_RX_FRAG][EMAC_ETH_MAX_FLEN>>2];
00081 static uint32_t tx_buf[EMAC_NUM_TX_FRAG][EMAC_ETH_MAX_FLEN>>2];

Is this buffer referring to the raw TCP data (with header)? Isn't this supposed to be placed into AHBRAM?

Also,In mem.c of core folder lwIP, there is ram_heap, Is this heap used to store the payload (application data) after stripping off the TCP headers? should I put it in RAM2?
__attribute__ ((section(".bss.$RAM2"))) u8_t ram_heap[MEM_SIZE_ALIGNED + (2*SIZEOF_STRUCT_MEM) + MEM_ALIGNMENT];

2) What is the typical setup for lwIP?
I'm using LPC1768/69, I understand the buffer should be placed in AHBRAM. How can I set up so that I only use one buffer for both received TCP packet and payload?

Will really appreciate if I can understand the flow of event from the data on PHY to the payload application data (and the corresponding variable in the code).Any info will be helpful :)

Outcomes