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: 
Explorer
Explorer
380 Views
Registered: ‎01-13-2018

Echo Server extension - ZYNQ Development Board

Hi, 

I am looking for working example of Echo Server LwIP for ZYNQ Development Board. Here I found a useful thread.  

https://forums.xilinx.com/t5/Embedded-Development-Tools/Extending-the-LWIP-Echo-Server/td-p/743738

I have some questions. 

If I modify Xilinx LwIP example by disabling Rx part and just reduce it to transmit to PC then which function I need to modify in main () ? 

print_ip_settings(&ipaddr, &netmask, &gw);

/* start the application (web server, rxtest, txtest, etc..) */
start_application();

/* receive and process packets */
	while (1) {
		if (TcpFastTmrFlag) {
			tcp_fasttmr();
			TcpFastTmrFlag = 0;
		}
		if (TcpSlowTmrFlag) {
			tcp_slowtmr();
			TcpSlowTmrFlag = 0;
		}
		xemacif_input(echo_netif);
		transfer_data();
	}

How to log/save the data in PC ?

Can it be Tera Term in PC which can be configured for TCP/IP to get continuous stream of data from ZYNQ board ?

I guess in my application the ZYNQ board will be server and PC will be client, right ?

 

 

0 Kudos
6 Replies
Xilinx Employee
Xilinx Employee
344 Views
Registered: ‎10-30-2017

Re: Echo Server extension - ZYNQ Development Board

Hi @joniengr081 ,

Please comment the recv_callback() function in accept_callback() function.

you need to write a client apllication in your PC to receive the data from Zynq and store it in a log and text file. Teraterm will also helps you in that. Yes, Zynq is Server and PC is client.

Best Regards,
Srikanth
----------------------------------------------------------------------------------------------
Kindly note- Please mark the Answer as "Accept as solution" if information provided is helpful.

Give Kudos to a post which you think is helpful and reply oriented.

0 Kudos
Explorer
Explorer
318 Views
Registered: ‎01-13-2018

Re: Echo Server extension - ZYNQ Development Board

@savula 

This means that I need to comment the following call inside the accept_callback function in the echo.c file. In this way the listening part on the ZYNQ side will be de-activated, right ? 

	/* set the receive callback for this connection */
	tcp_recv(newpcb, recv_callback);

My task is to send 32 bit of data every micro-second from SDK to PC over Ethernet. I am still not completely understand that on whcih variable in main () function I need to laod the data.   

0 Kudos
Visitor tsub4sa
Visitor
304 Views
Registered: ‎08-03-2018

Re: Echo Server extension - ZYNQ Development Board

Hi @joniengr081 ,

tcp_slowtmr must be called every 500ms and tcp_fasttmr every 250ms.

The function tcp_recv is used to register the callback function that should be called when your tcp connection receives data. If you comment tcp_recv function your software doesn't receive the callback. You should call the function xemacif_input to read packet ready to be read from the network interface.

To trasnmitt data through the tcp connection you have to call the tcp_write function.

 

0 Kudos
Highlighted
Explorer
Explorer
288 Views
Registered: ‎01-13-2018

Re: Echo Server extension - ZYNQ Development Board

My task is to send continuous data from ZYNQ to the network independent of any receiving data. The program should not listen to the network, it should send to the network. 

I am not sure where to find this function tcp_write().

I guess Xilinx should pay more attention to the documentation of LwIP and add some use cases and add some examples (other then echo server etc) to help the community to implement their tasks.

Visitor tsub4sa
Visitor
268 Views
Registered: ‎08-03-2018

Re: Echo Server extension - ZYNQ Development Board

If you read the XAPP1026 (https://www.xilinx.com/support/documentation/application_notes/xapp1026.pdf) , it'll give you all answers to your questions.

You can start from the "Echo Server" example to develop your application.

Anyway, tcp_write is a lwip library function (include file "tcp.h"). In general, in a lwip baremetal application, you have to create a new project including the lwip library,  and in your code call tcp_write based on need (see echo server).

Regards

0 Kudos
Explorer
Explorer
202 Views
Registered: ‎01-13-2018

Re: Echo Server extension - ZYNQ Development Board

Hi,


Now I found tcp_write function in the lwip library. It is found in the header file "tcp.h". I just have looked at the lwip library files. The code in header files is complex.


Is it really needed to understand the header files to implement and/or establish data transmission from ZYNQ to PC ?

The documentation of XAPP1026 shows that it is an old material, is it still valid ? Is there any other helpful document for lwip and it's possible modification ?

 

0 Kudos