TCP reception problem
Here I am, again. I've gotten my code to send and receive UDP and TCP packets pretty nicely - my DHCP server code is running well. Now, I am trying to receive a stream of TCP data, and I've found a new problem.
I set up a TCP connection and exchange packets with a tool running on my PC. The code handles five-byte packets and 400-byte packets flawlessly - but after a while, while the tool is sending a bunch of 20 similar 12-byte packets, the LWIP code reliably stops sending TCP ACK responses to my PC, which then starts sending retries and eventually times out. This always happens on the fifth 12-byte packet, which appears good when I look at it on Wireshark. The TCP/IP stack never hits the receive code for this packet - it acts like the ethernet interface has been disabled.
The code won't respond to a ping at all, so I can't determine if the stack code is still running. I have LWIP_ICMP = 1 in the lwipopts.h file. Is LWIP supposed to handle pings?
I traced the problem back into the stellarisif.c file - low_level_receive() - It hits this code:
| Code: |
/* We allocate a pbuf chain of pbufs from the pool. */
p = pbuf_alloc(PBUF_RAW, len, PBUF_POOL);
|
pbuf_alloc() returns NULL. Pbuf pools were not set up - I've tried enabling them with no change in the behavior.
It feels like I have a memory problem somewhere, but I can't find it. Any suggestions as to option settings i might have missed?
login or register to reply
|