Equipment: BBB, CCSv6, TI XDSv2 USB Emulator, Windows7, AM335X_StarterWare_02_00_01_01
Hi,
the aim is to send large blocks of data periodically via TCP/IP using LWIP. Lets say the period is 50ms.
Therefore I modified the enetEcho code example from AM335X_StarterWare_02_00_01_01 and after the connection has been established
if(ptSES_tcp_pcb->snd_buf) { // if there is send buffer available Tx.StartAdr = (DWORD)&Tx.Hd; Tx.Len = 0x9cf0; // this is what I would like to send, but the send buffer // available is only 12000 bytes at a maximum err = tcp_write(ptSES_tcp_pcb, (BYTE *)Tx.StartAdr, ptSES_tcp_pcb->snd_buf, TCP_WRITE_FLAG_COPY); }
is called periodically (50ms) to transfer as many bytes as possible. (Where ptSES_tcp_pcb->snd_buf is the available buffer space for sending (in bytes).)
If there is no free send buffer, tcp_write() is not called.
The problem is that only after 200ms (4 periods) there is send buffer available. And after tcp_write() has been called 5
times ( with 200ms between each call) no send buffer is available any longer (ptSES_tcp_pcb->snd_buf == 0).
The connection is for 100MBit/s( that is what enetEcho reports). So let's assume the effective speed is only 50MBit/s
(because buffers are copied internally for instance). Then 12000 bytes should be transferred within 1.92ms, I would expect.
What might be the reason for this behaviour? Is the client (Hercules in this case) responsible because it does not handle the data quick enough?
The WhireShark protocol however does not seem to contain any retransmission requests.
Or do I have to free any buffers somewhere? What is the recommended procedure for sending datat?
Can anybody help?
Every comment is very much appreciated.
Thank you.
Regards,
Martin H.