[Top][All Lists]

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

[lwip-users] Raw TCP - PBuf segment not decreasing

From: LRA_
Subject: [lwip-users] Raw TCP - PBuf segment not decreasing
Date: Sun, 17 Mar 2019 09:54:36 -0700 (MST)

Hello everyone,

First let me describe what I have:

- Microcontroller: TM4C1294
- LWIP version: 1.4.1 (port provided by TI)
- Using TCP raw. (no sockets since no RTOS)

What I am trying to do:
- I am trying to use TCP to send data over ethernet to a python application.
It's to have a behavior that I already have with UART with higher

Test case situation:
- Sending messages of 48 bytes at 2Khz. 

I have attempted:
- Just calling tcp_write. Leaving the slow send take care of it: Didn't
really work because it would need 48KB buffer.
- Calling tcp_out every 50ms or so: Caused issues. See bellow.

So what I am trying to do right now is to fill a buffer with tcp_write and
then call tcp_out periodically. 
I could in the future make it more dynamic (periodic+buffer full) but for
now this should work.
The problem I am facing might be because I don't quite understand lwip.

The current problem:
- The buffers don't get flushed fast enough. I am not sure if this is
because the python app is not reading fast enough.
- I am monitoring "lwip_stats". "mem" seems alright, I had some faults that
we're memory size problems that fixed through analyzing it. 
- In the connection pointer (pcb) is where I found something weird.
"snd_buf" and "snd_queuelen".
Well "snd_buf" from what I understood, it's the size on the current buffer,
there can be another buffer with space available. "snd_queuelen" seems to
have problems not overflowing (so the reason why I suspected slow receiver).
Not only that but even if I block until it goes to 0, 1, 2, etc, it reaches
a point where it blocks forever: it's like it slowly gets filled with dead
elements that will never leave.

I have attached the lwipopts.h that I am using at the moment.

I have been trying to solve issues around this for 2 weeks now. If someone
could help it would be appreciated :) 

Sent from: http://lwip.100.n7.nabble.com/lwip-users-f3.html

reply via email to

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