Programmable Devices
CPLDs, FPGAs, SoC FPGAs, Configuration, and Transceivers
21602 Discussions

Ethernet: Where to Start?

Altera_Forum
Honored Contributor II
2,550 Views

update: see my further below which will explain what i've managed to achieve so far. 

 

Hi Guys, 

 

problem: i need to know the simplest place/tutorial that i can create ethernet for my own cyclone iv board (i've got a De0-nano on the way for protoyping). 

 

my skills: 

Lets just go with I know nothing. I've done a basic make my own CPU with quatrus with VHDL and i KNOW OF Nios cores being basically an automatic creation of one of those. 

 

what have i been doing: 

Basically i'm an exhausted anf frustrated noob. I'm not just posting here saying "someone do my work for me". You've all been here trying to start learning and going crazy in the process. For a week+ I've been searching, reading, searching some more and I cannot see anything clear to help me get started with ethernet. I'm just getting more confused. People just say "drop the SOPC modules" and the other places say a lot more complex stuff. I'm going crazy and need a "babies first ethernet" tutorial or something to get f'n started. 

 

 

my grand plan: 

University project. I want to create my own FPGA that connects via ethernet to a PC/Network where i can write my own windows application to send/recieve data. This FPPGA will also be connected to a D5M camera and video is one of the things i need to transmit. But the project is much bigger than this, but this is my current package of work. 

 

I really apperciate any help that anyone can give.
0 Kudos
14 Replies
Altera_Forum
Honored Contributor II
1,297 Views

Start by analyzing reference design.

0 Kudos
Altera_Forum
Honored Contributor II
1,297 Views

Thanks socrates.  

What is the simplest design you recommend? i have been looking at the Web Server design example for the DE2-115, but t still seems failry complex.
0 Kudos
Altera_Forum
Honored Contributor II
1,297 Views

Well, ethernet is pretty complex anyway, so you have to prepare for that.

0 Kudos
Altera_Forum
Honored Contributor II
1,297 Views

Any luck with doing this? I'm trying to do the same thing myself.

0 Kudos
Altera_Forum
Honored Contributor II
1,297 Views

update: 

i am by no means a master or yet to fully understand the workings of ethernet; so i'm just sharing my experiences in the hope it may make life easier for someone else. so give me some rep and lets try get these forums a place where people help, rather than just an "un-answered questions site" that many topics seem to be atm. 

 

thoughts 

Ethernet is difficult for a new person, it has quite a steep initial learning curve. 

There is no magic "put code here, push button and it sends" for a noob, but once you get an understanding it pretty much is that; trick is you have to understand first before you can use it at all. So i recommend reading the sources i'll give later. 

 

whats helping me to learn 

 

All sockets in most operating systems are based on Berkely Sockets. This is including the Niche Stack that altera uses. An excellent article on wikipedia simplfies it greatly.  

http://en.wikipedia.org/wiki/bsd_socket (http://en.wikipedia.org/wiki/bsd_socket

 

A faily good article pointed out by somone on these forums. 

This is for a UNIX system but its based on the berkely sockets so it can help you get the picture. 

The link posted by someone else in a seperate topic. 

http://www.abc.se/~m6695/udp.html (http://www.abc.se/~m6695/udp.html

 

A great source for the details is the book "tcp/ip sockets in c" by donahoo and calvert. 

 

details 

 

Go to this link where i explain how i got the simple socket server (SSS) example from altera to work on the DE2-115. 

http://alteraforums.com/forum/showthread.php?t=28837 

 

hardware: Get an example program for your particular board. I use the DE2-115 at this stage. Although the Nios part is bugged I used the Quartus files for the DE2-115 RGMII webserver example. 

 

software: See the link above for more detail. Note its best to hard code a MAC address as wiping your flash to do other examples must also wipe your MAC address (or i accidenlty did it somehow). 

Basically the niche stack auto recieves the data and puts it into the rx_buffer of the Socket structure. You need to play with the pointers and read off that buffer in bytes at a time (chars), remember to adjust your read and write pointers as you do so. 

 

where i'm up to 

 

I've mamaged to hack up the SSS example and using the learning sources i've managed to trim it to make a UDP server and a TCP server (crap ones but i've proven the concept). I wrote some code to recieve simple telnet message store and into a buffer on the FPGA. 

 

Currently i have them each with their own MicroCOS task, one for TCP and another for UDP. Which i just replaced the SSS example task with them instead. 

 

where to for me? 

now i'm moving onto video until i understand what kind of data i'm dealing with before making a more advanced ethernet app to send the video.
0 Kudos
Altera_Forum
Honored Contributor II
1,297 Views

Thanks for referring me. I'm trying to do what's essentially done in the DE2_NET demo for DE2 boards on the DE2-115, just sending lots of data very fast over the Ethernet port. I originally tried porting over the code, but found that hte DE2 uses a DM9000A for Ethernet whereas the DE2-115 uses a Marvell 88E1111, which I thought wouldn't be that hard to change, but the Web Server demos are a much higher level of abstraction from the base hardware so as to be almost useless to me. Do you know how I can access the Marvell 88E1111 directly in Nios II and send data over Ethernet that way?

0 Kudos
Altera_Forum
Honored Contributor II
1,297 Views

Only by using the niche stack from the SSS example. It specifically supports the Marvell chip

0 Kudos
Altera_Forum
Honored Contributor II
1,297 Views

Not the Niche Stack, but Triple-Speed-Ethernet core.

0 Kudos
Altera_Forum
Honored Contributor II
1,297 Views

using SOPC, there is ethernet IP

0 Kudos
Altera_Forum
Honored Contributor II
1,297 Views

Hello im using De2-115 for my final year project and i need to know how to start using the ethernet connection, im trying to understand the web server example in the demonstrations folders, but still i need a more detailed explanation and clear steps to start!! 

 

Thank you in advance!
0 Kudos
Altera_Forum
Honored Contributor II
1,297 Views

There are no major explanations. Use TCP/IP stack manual and learn from the code... It's only way to do this. I'd offer You to run LwIP, it is opensource and well documented.

0 Kudos
Altera_Forum
Honored Contributor II
1,297 Views

Yes avoid the Niche stack its driving me crazy. Damn DHCP stopped again and i don't have the time for its **** again.

0 Kudos
Altera_Forum
Honored Contributor II
1,297 Views

so any one can help me now in this issue 

From where should I bigen? or some helpful references
0 Kudos
Altera_Forum
Honored Contributor II
1,297 Views

 

--- Quote Start ---  

so any one can help me now in this issue 

From where should I bigen? or some helpful references 

--- Quote End ---  

 

 

If you're using a DE2, check out this thread http://www.alteraforum.com/forum/showthread.php?t=3947
0 Kudos
Reply