VERSION 2.0 Lab 3: Ethernet

4
Lab 3: Ethernet Overview This lab will get you familiar with creating an Ethernet peripheral that will allow you communication between a PC and your board. Theory Completely new to network communications? Two options, either hit up your friends who took Networks for their lecture notes or check out the wiki article on the OSI model: en.wikipedia.org/wiki/OSI_model . Don’t stop there, of course, also check out Ethernet articles, or find a professor who teaches networking classes. Xilinx has a xilnet proprietary TCP/IP stack, if you’d like to acquaint yourself with the specifics of the stack check out the document here: www.xilinx.com/ise/embedded/ edk6_3docs/oslibs_rm.pdf Xilinx also uses the lwIP TCP/IP stack, if you’d like to acquaint yourself with the specifics of the stack, go to the development site: savannah.nongnu.org/projects/lwip/ Finally, there may be some tool incompatibility with the Ethernet IP and CMU’s licenses. If you run into problems, let me know and I’ll post instructions on how to update the IP. Step 1: Setup Open up an older project that you used for lab 2 or lab 1 or create a new project if you would like to try this all by itself. (Either way make sure that your Ethernet_MAC is present and connected to the PLB). In order to be able to use your Ethernet controller, you need to setup the lwip library. To do this, go to Software Software Platform settings. Check the box lwip as shown below: 18-545 VERSION 2.0 PAGE 1 OF 4

Transcript of VERSION 2.0 Lab 3: Ethernet

Page 1: VERSION 2.0 Lab 3: Ethernet

Lab 3: EthernetOverview

This lab will get you familiar with creating an Ethernet peripheral that will allow you communication between a PC and your board.

TheoryCompletely new to network communications? Two options, either hit up your friends who took Networks for their lecture notes or check out the wiki article on the OSI model: en.wikipedia.org/wiki/OSI_model. Don’t stop there, of course, also check out Ethernet articles, or find a professor who teaches networking classes.

Xilinx has a xilnet proprietary TCP/IP stack, if you’d like to acquaint yourself with the specifics of the stack check out the document here: www.xilinx.com/ise/embedded/edk6_3docs/oslibs_rm.pdf

Xilinx also uses the lwIP TCP/IP stack, if you’d like to acquaint yourself with the specifics of the stack, go to the development site: savannah.nongnu.org/projects/lwip/

Finally, there may be some tool incompatibility with the Ethernet IP and CMU’s licenses. If you run into problems, let me know and I’ll post instructions on how to update the IP.

Step 1: Setup

Open up an older project that you used for lab 2 or lab 1 or create a new project if you would like to try this all by itself. (Either way make sure that your Ethernet_MAC is present and connected to the PLB).

In order to be able to use your Ethernet controller, you need to setup the lwip library. To do this, go to Software ➙ Software Platform settings. Check the box lwip as shown below:

18-545 VERSION 2.0

PAGE 1 OF 4

Page 2: VERSION 2.0 Lab 3: Ethernet

Next, you need to input the correct MAC address for the build to know what the board’s MAC is. To get this number, look at the upper left hand corner of the board. There is a small sticker with a 6-byte hex number, this is your MAC address.

On your Xilinx screen, click on the “OS and Libraries” and expand “lwip”, which is in the lower half of the screen. Click on “emac_instances” under the column “Current Value”. This will pop open a new window. Within each of the eth_addr# slots, type in each byte of the MAC address: be sure to start each byte with a “0x”, so for instance if you wanted to enter AC for your first byte, you would enter 0xAC. Enter your entire MAC address, it should be something as to what’s shown below:

18-545 VERSION 2.0

PAGE 2 OF 4

Page 3: VERSION 2.0 Lab 3: Ethernet

Click OK and then OK again. Now your Ethernet should be set up. To verify that it is, build your project and make sure that you don’t get any errors.

Step 2: Make your Ethernet do something cool

Download the lab3.zip file from blackboard. This file is an example project that uses an older TCP/IP stack, xilnet v1.00. For your projects you might want to upgrade to xilnet v2.00 or even change over to the lwip stack. However, lwip has problems in 9.1i and you might be better off with xilnet.

Unzip the lab3.zip and extract it to C:/EDK. Next, download the lab3_xilnet.zip file from blackboard and extract it to C:\EDK\sw\lib\sw_services. You will be asked if you want to overwrite the existing files. Click yes. This is reinstalling the older xilnet v1.00.

Now, connect your board using a cross over cable to your computer. There are cables labeled X/O in the closet, these are your cross over cables.

Now, we’re going to set up the connection on the computer to be able to accept the direct connection between the board and the computer. Open up your network connections, go to your network connection (probably Local Area Connection 2) and click on Properties. Highlight TCP/IP and click on properties again. In the new window

18-545 VERSION 2.0

PAGE 3 OF 4

Page 4: VERSION 2.0 Lab 3: Ethernet

that pops up select “use the following IP address” and type in 192.168.0.1 and press tab. You should have a window that looks something similar to this:

Click OK, OK again (this will take a while for windows to set the connection) and then go back to your XMP build.

Read through the code for the software project TestApp_Emac_Onewire, determine what the project is supposed to do based upon the code, load the code to the board, and generate an output.

Step 3: Demonstration

Find a TA and tell them:

1. What does the code do?

2. How can you verify that the data is being sent to the computer?

Demonstrate an output on your PC from the board. (you should be able to use an internet browser or if that doesn’t work show what data is flowing through telnet)

18-545 VERSION 2.0

PAGE 4 OF 4