lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lwip-users] TCP data exchange quickly stalls


From: R. Diez
Subject: [lwip-users] TCP data exchange quickly stalls
Date: Tue, 7 Jan 2014 08:19:48 +0000 (GMT)

Hi all:

I am a newcomer to lwIP, I am developing a bare metal embedded firmware that 
will need to communicate with peer devices in the future. For now, I am using 
the loopback interface for developing purposes. The lwIP version is 1.4.1. Both 
the listening and the client side are on the same firmware running on an 
STM32F29 evaluation board.

When the single TCP connection is established, both connection ends send every 
now and them a few bytes of known data. After both ends have sent 2 packets of 
data, each side receives just 1 packet with the right data inside. Then no 
packet is ever received again, even though many more packet data continue to 
get queued. The data amounts are very small. On every attempt the amount 
reported by tcp_sndbuf() decreases over time down to 0 on both connection ends.

I've tried everything I could think of. I've searched the documentation, I've 
filled the code with error checks and asserts, the tcp_recv() callback does 
call tcp_recved() and pbuf_free( p ), I am calling tcp_output() at regular 
intervals, etc.

I have also enabled debug and statistics all over the place. After more than 20 
pieces of data sent, the LINK stats look like this:

  xmit: 5
  recv: 5
  drop: 3
  memerr: 3

Everything else is 0.

I have read about lack of memory being a possible cause for the dropped 
packets, so I have increased the following symbols to these values:

  #define LWIP_LOOPBACK_MAX_PBUFS 30  // Default was 10.
  #define PBUF_POOL_SIZE 64           // Default was 16.
  #define TCP_SND_QUEUELEN 64         // Default was 8.

That hasn't helped. What could I do in order to try and narrow the problem 
down? If this is a memory problem, what memory-related symbols could I try 
increasing?

Many thanks in advance,
  rdiez



reply via email to

[Prev in Thread] Current Thread [Next in Thread]