UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Adventurer
Adventurer
555 Views
Registered: ‎12-02-2016

Transfer data over TCP in Zynq: tcp_output(pcb)

Jump to solution

Hello,

I have posted few times about this question, but not able to solve the problem. 

 

Our aim is to send 6000 samples over TCP. We are able to send 1500 samples so far, but when we increase sending buffer size to more than that, we are not able to see any packets received on Wireshark. 

We use this function for the transmission 

 

				tcp_output(accepted_pcb);
				//xil_printf("send data");
				tx_data(outputBuffer, 6000, &depth, 100, accepted_pcb);

 

 

uint32_t tx_data(u32_t* data, u32_t lenData, u32_t* header, u32_t lenHeader, struct tcp_pcb *pcb) {
	u32_t *tcpFrames[MAX_FRAMES];
	u32_t framesCreated;
	u32_t framesSent = 0;
	u32_t maxFrameLength = 0;
	err_t err;

	framesCreated = build_tx_data(data, lenData, header, lenHeader, tcpFrames, &maxFrameLength);

	//xil_printf("\n %d TCP frames created\n", framesCreated);
	//xil_printf("\n %d TCP frames\n", tcpFrames);
	xil_printf("\n %d maxFrameLength\n", maxFrameLength);
	for(int i=0; i<lenData; i++){
		xil_printf("%d,", data[i]);
	}

	while(framesSent < framesCreated) {
		if(tcp_sndbuf(pcb) >= maxFrameLength) {

			err = tcp_write(pcb, tcpFrames[framesSent], maxFrameLength, 1);

			if(err)
			{
				xil_printf("Error: %d", err);
			}
			framesSent++;
		} else {
			tcp_output(pcb);

			framesSent++;
		}

	}

	free(tcpFrames[0]);

	//tcp_write(pcb, tcpFrames[framesSent], maxFrameLength, 1);
	tcp_output(pcb);

	return framesCreated;
}

 

We are able to see that TCP created max frame length according to 

u32_t totalLength = lenDataB + lenHeaderB + 2*sizeof(u32_t);

 

It would be really helpful if someone can guide us what are we missing or what we are doing wrong, Appreciate someone help! 

 

Thank you!

 

Best Regards

 

0 Kudos
1 Solution

Accepted Solutions
Highlighted
Adventurer
Adventurer
643 Views
Registered: ‎12-02-2016

Re: Transfer data over TCP in Zynq: tcp_output(pcb)

Jump to solution
Just an update, I am able to transfer 40Kbytes of data. i.e 10K Samples each sample size is 4byte. with mostly change in BSP settings.

View solution in original post

0 Kudos
1 Reply
Highlighted
Adventurer
Adventurer
644 Views
Registered: ‎12-02-2016

Re: Transfer data over TCP in Zynq: tcp_output(pcb)

Jump to solution
Just an update, I am able to transfer 40Kbytes of data. i.e 10K Samples each sample size is 4byte. with mostly change in BSP settings.

View solution in original post

0 Kudos