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
Hi ,
I want set network parameters for simple socket server example statically. I am not using DHCP server. I want to read all network settings like IP address, subnet mask from flash. How can I have network settings file in flash and the how simple socket server application can read network settings from flash. I want to have HTML web server application in flash which can be accessed by normal web browser and network settings can be configured. - Altera_Forum
Honored Contributor
1.The tutorial mentioned that we will use "sopc_system.sopcinfo ",shall we follow the instruction?
2.Step 3 is "Take the Quartus DE2_115 webserver example for Enet0 RGMII that comes on the CD and use quartus flash programmer to program."Why have we do this? - Altera_Forum
Honored Contributor
Hi all. I recently went through the exercise of getting the simple socket server to run on the DE2-115. The first guy who posted got it to work with version 10.1, I got it to work with Quartus 13.0 and the SBT for Eclipse.
I had to make some slightly different modifications to the code to get it to work with the template that comes with 13.0, so I thought I would share it here. The entire process I went through is documented in the attached word document. The code is in the zip file. - Altera_Forum
Honored Contributor
I am trying to get the most recent files (above this post) to work. Does the above example have the modification to code outlined in document already applied? I had to manually enter the CFI/EXT mod. So perhaps not? I am stuck at the:
Can't read the MAC address from your board (this probably means that your flash was erased). We will assign you a MAC address and static network settings And don't seem to be getting anywhere copying the old code at the start of this thread either. Any pointers? - Altera_Forum
Honored Contributor
--- Quote Start --- I am trying to get the most recent files (above this post) to work. Does the above example have the modification to code outlined in document already applied? I had to manually enter the CFI/EXT mod. So perhaps not? I am stuck at the: Can't read the MAC address from your board (this probably means that your flash was erased). We will assign you a MAC address and static network settings And don't seem to be getting anywhere copying the old code at the start of this thread either. Any pointers? --- Quote End --- Hi, I am too getting the same error, I have Quartus 12.0 edition & After downloading DE2_115_WEB_SERVER.sof I am trying to Download the application code (flash file system) for web server. But it gives the following error & asks to type the serial number. Actually I didn't find 9 digit serial number starting with ASJ on DE2115 board. Can anyone please help. --> Copyright 1996-2008 by InterNiche Technologies. All rights res prep_tse_mac 0 Can't read the MAC address from your board (this probably mean that your flash was erased). We will assign you a MAC address static network settings Please enter your 9-digit serial number. This is printed on a label under your Nios dev. board. The first 3 digits of the label are ASJ and the serial number follows this. -->Created "Inet main" task (Prio: 2) Created "clock tick" task (Prio: 3) - Altera_Forum
Honored Contributor
--- Quote Start --- Hi all. I recently went through the exercise of getting the simple socket server to run on the DE2-115. The first guy who posted got it to work with version 10.1, I got it to work with Quartus 13.0 and the SBT for Eclipse. I had to make some slightly different modifications to the code to get it to work with the template that comes with 13.0, so I thought I would share it here. The entire process I went through is documented in the attached word document. The code is in the zip file. --- Quote End --- cheers mate :) - Altera_Forum
Honored Contributor
--- Quote Start --- Hi all. I recently went through the exercise of getting the simple socket server to run on the DE2-115. The first guy who posted got it to work with version 10.1, I got it to work with Quartus 13.0 and the SBT for Eclipse. I had to make some slightly different modifications to the code to get it to work with the template that comes with 13.0, so I thought I would share it here. The entire process I went through is documented in the attached word document. The code is in the zip file. --- Quote End --- using hardware design attached with the tutorial on this link https://www.altera.com/support/support-resources/design-examples/intellectual-property/embedded/nios-ii/exm-net-std-de.html there is no hardware design related to DE2-115 I tried (niosii-ethernet-standard-3c120.zip ) related to Cyclone III, and I am facing a problem with pin assignment could you please help me thanks in advance - Altera_Forum
Honored Contributor
I tried it but I still have some problems, during runing I got the MAC and IP addresses and after nearly 1min
I got the following message from the Console then I lose the ip and MAC Using cable "USB-Blaster [USB-0]", device 1, instance 0x00 Processor is already paused Reading System ID at address 0x0B000140: ID value verified Timestamp value was not verified: value was not specified Initializing CPU cache (if present) OK Downloading 00000000 ( 0%) Downloading 00010000 (19%) Downloading 00020000 (38%) Downloading 00030000 (57%) Downloading 00040000 (76%) Downloading 00050000 (95%) Downloading 00054290 (97%) Downloaded 337KB in 6.6s (51.0KB/s) Verifying 00000000 ( 0%) Verifying 00010000 (19%) Verifying 00020000 (38%) Verifying 00030000 (57%) Verifying 00040000 (76%) Verifying 00050000 (95%) Verifying 00054290 (97%) Verified OK Leaving target processor paused - Altera_Forum
Honored Contributor
Hi guys,
m trying to replicate the results here. I believe im following all the correct steps, but when i run it, no text shows up in the nios console window. It downloads ok, but i get no errors, no messages, just a blank screen. Does anyone know what mght be causing that or what to check? I am not loading anything to flash memory. just programming the sof and the elf. never get to the code that says printf("\nSimple Socket Server starting up\n"); i dont think im getting past here: while (!iniche_net_ready) TK_SLEEP(1); and i get some kind of terminated exit value on the download inside the debug window? see attached The last thing that shows up on the console is listenng on port ... for connection from GDB, thats in debug mode. see attached Also, i dont get any complaints about mac address like this: "Can't read the MAC address from your board (this probably means that your flash was erased). We will assign you a MAC address and static network settings" One other thing: in the bsp editor, for the stdin,out,err, i dont have the option for "peripheral_subsystem_jtag_uart"... just jtag_uart. but i think thats ok as the qsys file just says jtag_uart. but this might be a reason i dont see any output on screen thanks - Altera_Forum
Honored Contributor
So it looks like im not getting the MAC address either. I can hardcode the mac address into the code, but i dont know what the mac for my de2-115 is. How can i find out what its set to?
thanks