Jump to content
  • 0

Nexys4 DDR ethernet


weirao

Question

Recently, I'm working with the Nexys4 DDR. What I want to do is to control a peripheral device and get data from it via PMOD port, and then send the data to the PC from Ethernet port. By learning the tutorials, now I can get the data and save the data to DDR, and fetch the data from DDR via UART. However, for several days, I can not make the ethernet work. I have studied the tutorial "Getting Started with Microblaze Servers". When I finished the tutorial, I still don't know how to use it in my own project. Actually, I  even don't understand what the purpose of each step of the tutorial. The reference manual says the PHY can be accessed only by using two IP core, ati_ethernetlite and mii_to_rmii . So I am confused that why this tutorial looks like so complicated. And I want to know is there any simple tutorials or examples about the ethernet control? I am a beginner of the FPGA program, please forgive my stupid questions.

Link to comment
Share on other sites

4 answers to this question

Recommended Posts

Hello,

The ethernet lite IP uses the lwip stack. Its wiki can be found here. http://lwip.wikia.com/wiki/LwIP_Wiki

You should be able to use the same hardware setup as the servers demo plus your Pmod connection. The hard part will be determining how to get data straight to your computer. The way I can immediately think of (I'm by no means an expert) is to set up a "server" on your computer that waits for data coming in to its socket then prints it out on arrival. You would then need to figure out how to act as a client from your program to send the server data.

 If you just want to be able to query your board for data at a constant rate, you may want to just use the server demo you built and instead of sending back an echo, grab data from your Pmod and send that.

Long story short there isn't a simple demo that basically replaces a UART connection with ethernet but with some digging it shouldn't be too hard. 

The tutorial mostly focuses on the hardware setup which is mostly dealing with building the base design for a microblaze project. Maybe more explanation of why things are set up the way they are could be something to add to the tutorial going forward! Id be happy to explain any parts you don't understand.

-Sam

Link to comment
Share on other sites

Hi Sam,

Thanks for you explanation, It is very helpful. I think I have got some knowledge about the MicroBlaze and LwIP.

This morning I researched the c language codes of the echo_server project. Found that the data come in the server by a function defined as tcp_recved(), and then echo back by a function defined as tcp_write(). When the data get in the server, it seems to be saved in a buffer automatically. There is no control parameter in  tcp_recved(). But in the write function tcp_write(), there is a input parameter p->payload to indicate that from where begin to send out the data.

So I think if I want to instead of sending back the echo, I can modify the input data of the tcp_write(). But here comes the questions. 

1. How can I connect the data from Pmod to the input data of tcp_write(). The SDK seems totally be separated with the FPGA board. So Do I need add the Pmod port in the Vivado? The function tcp_write() always get data from the buffer, so if I add the Pmod, how can I put the data in the buffer, and how to control the pointer p->payload point to the location where my data is at.

2. I want to know is there a reference manual about how to use the SDK functions, it is not easy to figure out the meanings of all the functions and parameters used in the project.

Link to comment
Share on other sites

1.) The real question is how to get the Pmod's data into microblaze. Which Pmod are you using? If it is one of digilents, there is a good chance we have a Pmod IP core that will make getting data easy in microblaze. The list can be found here. If you already have written some HDL to interface with the Pmod, you may need to follow this guide to create your own axi IP core that can transfer your data to microblaze.

2.) Xilinx has this but it is pretty hidden. While in SDK you can go to system.mss in the BSP. Then you can click on the Ethernetlite documentation. This will take you to Xilinx's documentation of the sdk libraries associated with that IP. You can also import examples from system.mss

-Sam

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...