This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TCP connection lost when TX buffer is full

Hi,

I'm using TCP connection between C6678 and PC (with static IP) and DSP sends data faster than the PC is able to receive and eventually the DSP TCP Tx buffer gets full, the transmission stops and doesn't start again.
On DSP side I have a multithread project with a thread dedicated to TCP communication.
The PC application is based on the helloworld app and it just receives data, doesn't try to close the connection or something like that.
If I use a blocking socket the DSP goes to the idle thread and if it's non blocking I get an EWOULDBLOCK error (as expected), but the transmission is not restored.
Using Wireshark I see that some seconds after the transfer stops there's an ARP request, the DSP answers back but the transmission is not restored (see picture attached).

So I'd like to know what exactly happens when TCP buffer is full and what I should do to restart transmission (I think this should happen automatically, but it isn't).

Tools versions:

CCS             5.1.0.09
C6000 compiler     7.4.0
SYS/BIOS         6.34.4.22
MCSDK            2.1.2.6
PDK_6678         1.1.2.6
NDK             2.22.03.20

Thanks

  • Is possible to avoid TCP Tx buffer full? There is a link for this: http://e2e.ti.com/support/embedded/bios/f/355/t/253488.aspx

    Regards, Eric

  • Thanks for your answer Eric.

    Yes, I can try to avoid the buffer getting full (that's what I'm doing now), but I'm interested in discovering why I'm getting such error when the buffer is full.

    Meanwhile I'll try the driver alterations you pointed to.

    BR,

    J.

  • Hi Eric,

    After some more debug I see that the buffer that I'm getting part of a message overwritten by the message that is sent after it. Like this:

    Msg 1 to be sent by DSP: AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA

    Msg 2 to be sent by DSP: BBBBBBBBBBBBBBBBBBBBBBBBBBBBBB

    Buffer received by PC:       AAAAAAAABBBBBBBBBBBBBBBBBBBBBBB

    Is this possible? To have some kind of memory fragmentation in TCP buffer or some packets not being delivered?

    Adding to my cfg: I use just one send() with whole message buffer (about 200 KB) with a non blocking socket, instead of sending smaller packets and also I have a fdPoll (with POLLOUT) before trying to send data and Ip.socketBufMinTxSize is higher than the buffer size. This way I'm trying to avoid sending just a part of the buffer and also that it only tries to send if there's enough free space.

    Thanks

    J.