Forum Discussion
WORKING: DE2-115 Simple Socket Server
Hi,
It seems difficult to get help on these forums so I want to pass on what i learnt for others. I've struggled to learn FPGAs over the past few weeks and I have finally got a simple socket server working for the DE2-115. I'll quickly post my findings so someone else can take this and learn from it and not have to struggle on their own as i did. procedure I'll make this brief:- I used updated versions for everything as of 4/4/11. 10.1 Sp1.
- Download and install the Knowledge base update to prevent nios from crashing. http://www.altera.com/support/kdb/solutions/rd12222010_317.html
- Take the Quartus DE2_115 webserver example for Enet0 RGMII that comes on the CD and use quartus flash programmer to program.
- Get this PDF and follow its instructions "http://www.altera.com/literature/tt/tt_nios2_tcpip.pdf?gsa_pos=1&wt.oss_r=1&wt.oss=simple socket server example nios edition socket server example nios edition" NOTE it includes the spaces (wierd). do everything the same except the part mentioned in my next step.
- Instead of copying the files from the tutorial.zip; copy the ones that i have attached to this post. (the .c and .h files including the eeprom folder)
- This example will now work as explained in the pdf.
- The original example code in the tutorial does not have the correct method for gettig the MAC address on the DE2-115. I have deleted the majority of the original MAC code and replaced it with code i got from the DE2-115 webserver example. This includes the flashgetoffset function.
- The LED_PIO_BASE in the original is an invalid for the DE2-115. I replaced it with the LEDG (green leds), you could replace it with red if you wished. This has been done by modifying the led.c file.
66 Replies
- Altera_Forum
Honored Contributor
When you disable DHCP.
Just use a cross-over cable and set the computer's IP address to 192.168.10.235, set the IP in simple_socket_server.h to 192.168.10.234. And you should set you PC to 1000Mbps or 100Mbps instead of Auto-negotiation. Good luck to you! - Altera_Forum
Honored Contributor
thanks bjtuxuxu for your reply
when I disable the DHCP the application won't build and I can't download the elf file to the target so I enable it but I connect directly FPGA to the host and it's work but I don't know if enable DHCP will add some overhead even I don't use it. can I escape the time spending to fin IP address from DHCP ? many thanks - Altera_Forum
Honored Contributor
When you disable the DHCP, it will not spend you any time to find IP address.
The IP, which will be used, is the one in# simple_socket_server.h# I ever met the same problem:when disable the DHCP the application won't build. Then I Generate Bsp again, and Build bsp project again, at last I can build the project. - Altera_Forum
Honored Contributor
--- Quote Start --- When you disable the DHCP, it will not spend you any time to find IP address. The IP, which will be used, is the one in# simple_socket_server.h# I ever met the same problem:when disable the DHCP the application won't build. Then I Generate Bsp again, and Build bsp project again, at last I can build the project. --- Quote End --- thank you anyway I'll keep it with the dhcp with direct connection between the fpga and the host I couldn't run the SSS with disabling the DHCP ! - Altera_Forum
Honored Contributor
--- Quote Start --- If you are wanting to send UDP messages, then you need to change your type to SOCK_DGRAM and the protocol (last parameter) to IPPROTO_UDP in your socket call. Once you have the type and protocol set for UDP, then your recvfrom() call should block until data is ready on the fd. --- Quote End --- Thank you lornewellington can you please give us more details how to implement an UDP application ? what I have to change ? only the simple_socket_server.c file ? and what can of trandfert can be done with the udp ? many thanks in advance - Altera_Forum
Honored Contributor
hi, thank you. You have helped by providing this source. I don't know what to do if I didn't see this
- Altera_Forum
Honored Contributor
Hi to all :
this project is my goal currently, but, when i build the project, there're some errors . Here are some problem to ask : 1. when create the new bsp , which .sopcinfo to use ? (My board is de2-115 , ep4ce115f29c7n) I download from "nios ii ethernet standard design example" ,choose the file named "niosii-ethernet-standard-3c120.zip" 2."with a file management tool (such as windows explorer), drag and drop all the nios ii simple socket server source files and folders from the<tutorial_files>\nichestack_tutorial folder to the niosii_simple_socket_server_0 folder in the nios ii sbt for eclipse project explorer view." , I don't know where to copy .c .v etc. file . plz help me , best regard !
- Altera_Forum
Honored Contributor
omg , my sss is working!
here are another problem : when i telnet the board , it prints : ================================= Nios II Simple Socket Server Menu ================================= 0-7: Toggle board LEDs D0 - D7 S: 7-Segment LED Light Show Q: Terminate session ================================= Enter your choice & press return: only type "Q" can terminate it , other choice can't work , how could i do ? (( i just use the basic project in NiosII IDE without modify)) regard - Altera_Forum
Honored Contributor
Hi ,I am new to fpga and NIOSII, i am trying to use simple web server eg given as a template in NIOSII ide. For that my first step was ,i included dm9000a driver in qsys and connected it with appropriate pins in quartus bdf. When i tried to run the eg on NIOSII. i got the following message (down)which is very familiar here but i cannot figure out what should i do. Please if someone can post some help soon,Your help will be highly appreciated. My board is DE2. (2c35f672c6 FPGA)
interniche portable tcp/ip, v3.1copyright 1996-2008 by interniche technologies. all rights reserved.
prepped 0 interfaces, initializing...
inet startup error: unable to find any working interfaces
panic: ip
dtrap - needs breakpoint Regards
- Altera_Forum
Honored Contributor
Hi is this code compatible with DE2 cyclone II ?