cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Visitor
Visitor
335 Views
Registered: ‎05-20-2020

Zedboard TCP LWIP Raw Application

Hi,

I'm using zedboard for TCP client server communication using LWIP Raw API. Assigning Zedboard as a client and host PC as a server I'm able to send data from board and receive at the host PC. But, when I try to transfer continuous data transfer from board, application is exiting with "No memory for zero copy pbuf" . Please check my code below for further information. I'm running a simple winsock application at server side to just receive data and nothing else. I've checked send_queue and its increasing with each packet transfer from application. Since I'm a newbie in this board so I dont know expected values.Default value of TCP_SND_BUF is 8192 but I changed in my code to 16384 because earlier board(client) wasn't able to connect to server. I've searched online and checked various forums but no success in debugging.

Tool: Xilinx SDK 2017.4, LWIP 1.4.1

Since we need Standalone application so using Raw API

 

Initialised values:

TCP_MSS - 1460
TCP_SEND_BUFSIZE = 1460 (*5) = 7300
TCP_SND_BUF - 16384
TCP_SND_QUEUELEN = 179.55 (Calculated)

while (tcp_sndbuf(c_pcb) > TCP_SEND_BUFSIZE) {
err = tcp_write(c_pcb, send_buf, TCP_SEND_BUFSIZE, apiflags);
if (err != ERR_OK) {
xil_printf("TCP client: Error on tcp_write: %d\r\n",
err);
return err;
}

err = tcp_output(c_pcb);
if (err != ERR_OK) {
xil_printf("TCP client: Error on tcp_output: %d\r\n",
err);
return err;
}
client.total_bytes += TCP_SEND_BUFSIZE;
client.i_report.total_bytes += TCP_SEND_BUFSIZE;
}

 

I'm calling above code continuosly by filling send_buf with random generated data. Please help me

 

0 Kudos
Reply
1 Reply
Moderator
Moderator
221 Views
Registered: ‎12-04-2016

Hi @Chetan140 

Try to flush the cache before actually reading the data. May be you can try using this API to do the same

Xil_DCacheFlush();

 

Best Regards

Shabbir

0 Kudos
Reply