FPGA, SoC, And CPLD Boards And Kits
FPGA Evaluation and Development Kits
Intel Support hours are Monday-Fridays, 8am-5pm PST, except Holidays. Thanks to our community members who provide support during our down time or before we get to your questions. We appreciate you!

Need Forum Guidance? Click here
Search our FPGA Knowledge Articles here.

DE2-115 Web Server Example

Honored Contributor II



I'm new to Quartus and Nios, and I've been trying to get the DE2-115 web server example (RGMII-ENET0) running with no luck. I followed the instructions in the user manual trying the bat file first. 


Using Nios 10.1 I: 

  1. Programmed the flash with the file DE2_115_Web_Server\DE2_115_WEB_SERVER_RGMII_ENET0\software\web_server_0_syslib\ro_zipfs.zip in Nios II Flash Programmer with the DE2_115_Web_Server\DE2_115_WEB_SERVER_RGMII_ENET0\DE2_115_SOPC.sopcinfo (attached is a screen shot of the programmer commands). 

  2. Ran batch file: DE2_115_Web_Server\DE2_115_WEB_SERVER_RGMII_ENET0\demo_batch\web_server.bat 

Console Output: 


tera\10.1\quartus\\bin\\quartus_pgm.exe -m jtag -c USB-Blaster[USB-0] -o "p;DE2_ 


Info: ******************************************************************* 

Info: Running Quartus II Programmer 

Info: Version 10.1 Build 153 11/29/2010 SJ Full Version 

Info: Copyright (C) 1991-2010 Altera Corporation. All rights reserved. 

Info: Your use of Altera Corporation's design tools, logic functions 

Info: and other software and tools, and its AMPP partner logic 

Info: functions, and any output files from any of the foregoing 

Info: (including device programming or simulation files), and any 

Info: associated documentation or information are expressly subject 

Info: to the terms and conditions of the Altera Program License 

Info: Subscription Agreement, Altera MegaCore Function License 

Info: Agreement, or other applicable license agreement, including, 

Info: without limitation, that your use is for the sole purpose of 

Info: programming logic devices manufactured by Altera and sold by 

Info: Altera or its authorized distributors. Please refer to the 

Info: applicable agreement for further details. 

Info: Processing started: Mon Dec 27 10:27:18 2010 

Info: Command: quartus_pgm -m jtag -c USB-Blaster[USB-0] -o p;DE2_115_WEB_SERVER 


Info: Using INI file C:/Documents and Settings/dreesewm/quartus.ini 

Info: Using programming cable "USB-Blaster [USB-0]" 

Info: Using programming file DE2_115_WEB_SERVER.sof with checksum 0x00E08E03 for 

device EP4CE115F29@1 

Info: Started Programmer operation at Mon Dec 27 10:27:19 2010 

Info: Configuring device index 1 

Info: Device 1 contains JTAG ID code 0x020F70DD 

Info: Configuration succeeded -- 1 device(s) configured 

Info: Successfully performed operation(s) 

Info: Ended Programmer operation at Mon Dec 27 10:27:26 2010 

Info: Quartus II Programmer was successful. 0 errors, 0 warnings 

Info: Peak virtual memory: 103 megabytes 

Info: Processing ended: Mon Dec 27 10:27:26 2010 

Info: Elapsed time: 00:00:08 

Info: Total CPU time (on all processors): 00:00:01 


Altera Nios2 Command Shell [GCC 3] 

Version 10.1, Built Tue Nov 30 02:10:00 PST 2010 



Welcome to the Nios II Embedded Design Suite 

Version 9.1, Built Thu Mar 25 01:25:52 PDT 2010 

Example designs can be found in 



(You may add a startup script: c:/altera/91/nios2eds/user.bashrc) 

Using cable "USB-Blaster [USB-0]", device 1, instance 0x00 

Resetting and pausing target processor: OK 

Initializing CPU cache (if present) 


Downloaded 345KB in 5.9s (58.4KB/s) 

Verified OK 

Starting processor at address 0x000001D0 

nios2-terminal: connected to hardware target using JTAG UART on cable 

nios2-terminal: "USB-Blaster [USB-0]", device 1, instance 0 

nios2-terminal: (Use the IDE stop button or Ctrl-C to terminate) 

InterNiche Portable TCP/IP, v3.1 

Copyright 1996-2008 by InterNiche Technologies. All rights reserved. 

prep_tse_mac 0 

Your Ethernet MAC address is 00:05:67:f0:13:53 

prepped 1 interface, initializing... 


INFO : TSE MAC 0 found at address 0x0b442000 

INFO : PHY Marvell 88E1111 found at PHY address 0x10 of MAC Group[0] 

INFO : PHY[0.0] - Automatically mapped to tse_mac_device[0] 

INFO : PHY[0.0] - Restart Auto-Negotiation, checking PHY link... 

INFO : PHY[0.0] - Auto-Negotiation PASSED 

INFO : PHY[0.0] - Checking link... 

INFO : PHY[0.0] - Link established 

INFO : PHY[0.0] - Speed = 1000, Duplex = Full 

OK, x=0, CMD_CONFIG=0x00000000 

MAC post-initialization: CMD_CONFIG=0x0400020b 

[tse_sgdma_read_init] RX descriptor chain desc (1 depth) created 

mctest init called 

IP address of et1 : 

Created "Inet main" task (Prio: 2) 

Created "clock tick" task (Prio: 3) 

Acquired IP address via DHCP client for interface: et1 

IP address : 

Subnet Mask: 

Gateway : 

Created "web server" task (Prio: 4) 

Web Server starting up 


Fetching file: /mnt/rozipfs/index.html. 

Can't open the 404 File Not Found error page. 

Have you programmed the filing system into flash? 

[http_handle_receive] Error preparing response 



I tried changing the base address to 0x00000000 due to some comments in the readme, but I still have the same error. 


I also tried building the example from the CD (v1.0.4) but the software doesn't do anything when you select Build All. Building from scratch with the Web Server Template gives the error: 


Description Resource Path Location Type 

make: *** [obj/alt_error_handler.o] Error 1 test_web_server_one line 0 C/C++ Problem 



Any help on this would be appreciated. 


0 Kudos
22 Replies
Honored Contributor II

I found the BSP Editor, Software Packages Tab.: ro_zipfs_offset was set to 0x100000. 


Using the Nios II 10.1 Command line I ran: 


bash-3.1$ bin2flash --input="c:/<path to>/ro_zipfs.zip" --output=ro.flashfs_cfi_flash.flash --location=0x100000 --verbose bash-3.1$ /cygdrive/c/Altera/10.1/nios2eds/bin/nios2-flash-programmer.exe ro.flashfs_cfi_flash.flash --base=0x0a800000 --sidp=0x9000140 --id=0x61f7c611 --device=1 --instance=0 --program --verbose --erase-all  


Then ran the .bat file in <path to>/demo_batch. Now the example works.
Honored Contributor II

Ok, now I got a compiled version running: 


1. Open up from CD: x:\<path_to>\DE2_115_1.0.4_CD\DE2_115_demonstrations\DE2_115_Web_Server\DE2_115_WEB_SERVER_RGMII_ENET0 DE2_WEB_SERVER.qpf file in Quartus 10.1 

2. Open SOPC Builder wait for project to load 

3. Click Generate 

4. Should be successful, click Exit 

5. Compile .qpf project in Quartus (I got over 600 warnings but it was successful) 

6. Program FPGA with new .sof file (mine has 'time-limited' in the name so I know which one is the new one 

7. Leave Open Core Status dialog box open 

9. Start up Nios 10.1 

10. Point the workspace to the same directory above and go into the software directory 

11. File > New > Nios II Application and BSP Template 

12. Choose the .sopcinfo file that is in the main project directory 

13. Give your new project a name (web_server_test) 

14. Choose Web Server RGMII template 

15. Click Finish 

16. Open up Nios 10.1 Command Shell and enter these commands in: 


cd /cygdrive/<path_to>/DE2_115_1.0.4_CD\DE2_115_demonstrations\DE2_115_Web_Server\DE2_115_WEB_SERVER_RGMII_ENET0 mkdir flash (if it is not already there) bin2flash --input="../software/web_server_test/system/ro_zipfs.zip" --output=ro.flashfs_cfi_flash1.flash --location=0x100000 --verbose nios2-flash-programmer.exe ro.flashfs_cfi_flash1.flash --base=0x0a800000 --sidp=0x9000140 --id=0x0 --device=1 --instance=0 --program --verbose --erase-all  


* Note 1: if you get any errors on these commands, you can check ids and timestamps in Nios Eclipse Program Nios II > Flash Programmer. The problem with the Flash Programmer is that it incorrectly puts the location = 0x0 for the bin2flash command 

* Note 2: There are two files systems that exist. You can use the default zip file system that gets created when you make the example. It's 39kB. Or you can add or replace the file system (in web_server_test/system) with the one from the example, it's 199kB and has more functions you can try on the board. It is located in web_server_0_bsp directory of the original DE2 software directory. 

17. Anyway you want to, copy the contents of the .c and .h files in software/web_server_0 into the same .c and .h files in web_server_test (don't worry about tse_my_system.c) 

18. In Nios II Eclipse > Nios II > BSP Editor , choose the bsp for your project 

19. Choose the Software packages tab, Settings > altera_ro_zipfs 

20. Be sure _base matches your SOPC Builder setting for the CFI_FLASH (mine is 0x0a800000) 

21. _name is /mnt/rozipfs  

22. _offset matches the location value you used in the bin2flash command above (0x100000 for me) 

23. Click Generate, wait until complete, then Exit 

24. Build the project and then exit out of Nios II (I was unable to run the project from Nios II because the program froze while running it) 

25. From the Nios Command line run 


nios2-download -g web_server_rgmii_test.elf && nios2-terminal  


* The software will pause and wait for a serial number, any 9-digit number will work 

* After you see "Web Server starting up" type in the address your DHCP server found in a web browser 


Have fun!
Honored Contributor II

Hi, thanks to this thread I managed to run the web server example as well. So thanks to windex! But I still have some problem with this web server.  


When the web server is up and running and i've changed my ip-address to the number next to the server's IP I don't get any connection. When I try to ping the server I get answer, but still 50% loss of packets.  


Why is it so slow? Anyone had the same problem? 

Thanks in advance :)
Honored Contributor II

Hi Erlendaa, 


that looks to me that you have problems with the SDRAM. There are timing problems with DE2 Board between the clock and the RAM. Have you tried to use just the the small CPU Implementation in SOPC Builder? That means the simplest without Cache. When this solves your problem the SDRAM has timing issues. 


Honored Contributor II

Hi Guys, 


Windex thank you for your effort in making this post. 

I'm working through it now.
Honored Contributor II

I'm having some trouble getting this going, i spent the past few days trying all sorts of combinations of tricks etc that i've read. Windex's guide is is by far the best thing i have seen while trying to get ethernet going on this de2-115. But this whole ethernet task is driving me postal. 


side note: My end goal is actually to get a simple socket server running so i can then write a custom windows app to connect to the board. If you know how to get this going on the DE2-115 that would be awesome. I've tried with no sucess atm. 


the webserver guide problem 


I've followed your exact tutorial up to step 16 but i'm not exactly sure if i'm doing it right.
  1. I assume the commands in setp 16 are 3 (or 4?) seperate commands? A cd/ to get to directory, a bin2flash and a flash program? 

  2. I've had to add a slash "\" to the end of the first command to get it to work, as in point to a directory. 


    --- Quote Start ---  

    mkdir flash (if it is not already there) 

    --- Quote End ---  


    I have no idea what this is meant to do and i cannot get the console to accept this command on its own or combined with the previous command. So i've had to ignore it. 

  4. I then do the bin2flash command and i get "(FINE) bin2flash: starting" plus then some infor on using that command itself. So i assumme this has worked? 

  5. I cannot get the flash program command to work. I just get 


    --- Quote Start ---  

    ro.flashfs_cfi_flash1.flash: Unable to open input file 

    Empty flash content cannot be programmed or verified 

    --- Quote End ---  



  • Also as you said i get a crash when i try to run the program in Nios EDS 10.1. I did get it to run the first time i tried, but this was before i saw your tutorial and i hadn't programmed any flash so the webserver obviously didn't work. 

  • For some reason if i just try to build the project rather than run it, i get undefined errors on two extern variables "lednum" and "segnum"; i assume this must be because the niche stack isn't included until runtime? 

Help from you guys would be awesome and I thank Windex again for this post plus i thank anyone in advance for helping me.
Honored Contributor II

Any luck with this, I'm trying to do a similar project.

Honored Contributor II

basically i dropped the webserver example and went for the simple socket example. I'll explain further in my topic here: 

Honored Contributor II

Hi Windex 


I try your support a methods[/U] 


I open the Nios 10.1 Command Shell and enter the code 


but , when I enter the code : nios2-flash-programmer.exe...--erase-all 


the message tell me  




There are two or more JTAG cables available but you have not  


chosen which one to use. please use the configuration dialog to pick one,  


or specify a value for the --cable parameter on the command line. 




I try a long time , but still appear this message ...
Honored Contributor II

I think the message is self explicit... If you have several USB blasters connected (a development kit connected through a USB cable counts as a USB blaster) you need to add the --cable and a number to select which one to use.

Honored Contributor II

Dear Daixiwen 


Thanks for Daixiwen , the question is solve. 


The question isdue to quartusii of programmer Hardware setup 


(need delet USB-Blaster of outside) 


but...I occur the new question , I referance  


http://www.alteraforum.com/forum/showthread.php?p=119191#post119191 (http://www.alteraforum.com/foru/showthread.php?p=119191#post119191


and I make step to No.16 


when enter the code : 


nios2-flash-programmer.exe ro.flashfs_cfi_flash1.flash ... --erase-all 


Message tell me  




Timestamp value was not verified : value was not specified 


The software you are downloading may not run on the system which is  


crrrently configured into the device . Please download the correct SOF or  


recompile . Leaving target processor paused 




so , I try to quartusii of programmer and recompile , then download to  


DE2-115. but...still can't and appear the message. 


And...other a question . 


When I bulid NiosII Application and BSP from Template , but not creat a 


nios2-flash-programmer.exe...I don't know this status.
Honored Contributor II

This messages appears because you don't have a system ID component in your SOPC system. Either add a system ID component (recommended) or add the correct option to the NIOS programmer to disable the system ID / timestamp check before download.

Honored Contributor II

Dear Daixiwen 


Thanks your support , I try again and again... 


1. QuartusII &#8594;SOPC Builder 


2. Add system id set "0" 


3. And generate &#8594; compilation Report &#8594; download 


but , when I open NiosII and New Application and BSP from Template 


I found...the project file of "de2_115_sopc.sopcinfo" is not update  


Result...the bsp fail of creat...so I think... 


how do due de2_115_sopc.sopcinfo for update ... 


maybe the question is for other places...I think
Honored Contributor II

The .sopcinfo file is updated automatically by SOPC builder each time you click on generate. Are you sure you are pointing to the right file? The one in the same folder than the SOPC project?

Honored Contributor II

Dear Daixiwen 


I check many times , the folder and project is same of directory. 


but , I found , the example of SOPC Builder  


already have system id for include , so I try again. 


1. Open d:\DE2_115_Web_Server\DE2_115_WEB_SERVER_RGMII_ENE T0  


DE2_WEB_SERVER.qpf file in Quartus 10.1 


2. SOPC Builder(no change anything to example)  


3. Click Generate(successful) 


4. Compile .qpf project in Quartus(but don't have download to de2-115)  


5. Start up Nios 10.1 &#8594; File > New > Nios II Application and BSP Template 


(Finsh reference of step No.11 ~ No.15) 


6. Open up Nios 10.1 Command Shell and enter code 


but ... the message again tell me  




Timestamp value was not verified : value was not specified 


The software you are downloading may not run on the system which is  


crrrently configured into the device . Please download the correct SOF or  


recompile . Leaving target processor paused 




I think...maybe , I need enter SOPC Builder 


and delet system id of original , and add new system id 


(system id parameters not change) 


maybe need this make... I will try again : ) 


p.s It is to strange , before in the SOPC Builder. 


If I add a new system id (I don't delet or change the origin system id). 


and Builder &#8594; Generate &#8594; Compile , but in the Nios 10.1 Command Shell 


haven't any questione , only questione is due to can't ... 


In NiosII download software to De2-115...
Honored Contributor II

Dear Windex 

I finsh!!! for function!!!!! 


After time , I will po my all make. 


p.s Thanks your help to until : )
Honored Contributor II

1. Open D:\demo\DE2_115_Web_Server\DE2_115_WEB_SERVER_RGMII_ENET0\DE2_115_WEB_SERVER.qdf 


2. Open SOPC Builder to Regenerate , finsh and compilation  


3. Open Nios II 10.1sp1 Software Build Tools for Eclipse  


4. New &#8594; NiosII Application and BSP from template 


5. SOPC Information name , select your project location of DE2_115_SOPC.sopcinfo 


6. Application poject select porject location , project reneme &#8594; web_server_test 


7. Templates select Web_Server(RGMII) , when finsh then exit the NiosII 


8. Open up Nios 10.1 Command Shell and enter these commands in: 


cd /.../DE2_115_Web_Server/DE2_115_WEB_SERVER_RGMII_ENET0  


mkdir flash 


bin2flash --input=D:/demo/DE2_115_Web_Server/DE2_115_WEB_SERVER_RGMII_ENET0/software/web_server_test/system/ro_zipfs.zip --output=ro.flashfs_cfi_flash1.flash --location=0x100000 --verbose 


nios2-flash-programmer.exe ro.flashfs_cfi_flash1.flash --base=0x0a800000 --sidp=0x9000140 --id=0x0 --device=1 --instance=0 --program --verbose --erase-all 


9. Download of QuartusII and DE2_115_WEB_SERVER.qdf 


10. Open up NiosII and Run hardware  


11. Enable browse for file system ELE file  


12. Select D:\...\DE2_115_Web_Server\DE2_115_WEB_SERVER_RGMII_ENET0\demo_batch\web_server_0.elf 


13. In Target Connection , System ID check &#8594; select ignore mismatched system ID and mismatched system timestamp 


14. Apply Run and open commend , enter ping xxx.xxx.xxx.xxx 


15. Enter the ip addres
Honored Contributor II

What do you mean by  

--- Quote Start ---  

(but don't have download to de2-115) 

--- Quote End ---  


After you compile the project in Quartus, you need to upload the .sof file to the FPGA before running the Nios environment.
Honored Contributor II

Dear Daixiwen 


Sorry , I haven't explanation of clear. 


(but don't have download to de2-115)  


The mean is , I wait for NiosII to bsp builder finsh. 


When I finsh about NiosII action , and this time , 


I make burn to de2-115 of QuartusII , then download NiosII : )
Honored Contributor II

Hello all, 

I've tried these steps, but It doesn't work. Could any one please say more details about flash programmer and what to do in steps. It seems a bit mixed up to me. Thanks in advance.