You are on page 1of 2

LightWeight IP (lwIP) Demonstration Project for Digilent Genesys board

(Originally created for the Xilinx ML505 board)


May 7, 2010

Usage:

1. Open the project in EDK


2. Connect the network cable to the board, it can be connected to a 100 or Gigabit switch, doesn’t
have to be connected directly to the computer. The IP address of the board can be changed in the
application to match your subnet.
3. Connect a serial cable to the board and open a terminal program. Set the terminal parameters to
baudrate 9600, 8 data bits, 1 stop bit, no parity.
4. Power on the board and see if the Ethernet PHY LEDs are showing a negotiated link.
5. From the menu, select “Project” → ”Launch EDK Shell” and type: impact –batch etc/download.cmd
or generate the bitstream from the menu or toolbar and download it from within EDK (“Device
Configuration” -> “Download Bitstream”
6. Open SDK. Switch to the workspace ..\Genesys_Lwipdemo\SDK\SDK_Workspace.
7. Indicate the correct hardware specification file
..\Genesys_Lwipdemo\SDK\SDK_Export\hw\system.xml. The system is built again. If errors appear,
clean all the projects and platforms and is rebuilt again.

The Lwipdemo is made in both raw mode in standalone and in socket mode using xilkernel. The demo
features the following applications:

- An echo server
- A tftp server
- A webserver
- A rxperf and a txperf server (I did not validated these to start, but this can be changed in the
source code)

Depending on which mode application You want to use (I suggest to try both to see the operating speed
of each component),

1. Open raw_apps/main.c or sock_apps/main.c and locate the following lines in the code:
/* Change to an IP address to match Your local subnet */
IP4_ADDR(&ipaddr, 192, 168, 0, 55);
IP4_ADDR(&netmask, 255, 255, 255, 0);
IP4_ADDR(&gw, 192, 168, 0, 1);
2. Change the IP address, netmask and gateway settings to match to your subnet and save the file to
rebuild the application.
3. In order to load the webserver with the memory file system contents in SDK in the XMD console
type:
connect mb mdm

cd ../Genesys_Lwipdemo
(where “../Genesys_Lwipdemo” is the path where the files were extracted. This folder
contains the image.mfs file that represents the memory file system contents for the
webserver.)

dow –data image.mfs 0x51000000

Wait until XMD displays “Downloading Data File -- image.mfs at 0x51000000”


Now you can run either the raw_apps or the sock_apps application, depending on which one
has changed to match the IP address.

After the terminal displays the auto-negotiated link speed, the board can be pinged or the echo server
or tftp server or webserver can be accessed.

Regarding the application interface performance it is very useful to start the rxperf server and txperf
client. In order to start the rxperf and txperf applications:

1. Open raw_apps/config_apps.h or sock_apps/config_apps.h and set


INCLUDE_RXPERF_SERVER and INCLUDE_TXPERF_CLIENT to 1.
2. Open raw_apps/txperf.c or sock_apps/txperf.c and locate the following lines in the code:
/* Change to the ip address of Your iperf server */
IP4_ADDR(&ipaddr, 192, 168, 0, 33);
3. Set the IP address to the IP address of the computer running the iperf server.

In order to use the rxperf and txperf application, see XAPP1026,


http://www.xilinx.com/support/documentation/application_notes/xapp1026.pdf, page
12. Iperf can be downloaded freely, for example, from http://freshmeat.net/projects/iperf

4. Start the iperf server on the computer running iperf using the commands from XAPP1026 or
from the terminal
5. Run the application on the board
6. Optionally start the iperf client on the host computer.

You might also like