Forum Discussion
DE2-115 Web Server Example
Hi,
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:- 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).
- Ran batch file: DE2_115_Web_Server\DE2_115_WEB_SERVER_RGMII_ENET0\demo_batch\web_server.bat
22 Replies
- Altera_Forum
Honored Contributor
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:
Then ran the .bat file in <path to>/demo_batch. Now the example works.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 - Altera_Forum
Honored Contributor
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:
* 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 runcd /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
* 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!nios2-download -g web_server_rgmii_test.elf && nios2-terminal - Altera_Forum
Honored Contributor
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 :) - Altera_Forum
Honored Contributor
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. Urmel - Altera_Forum
Honored Contributor
Hi Guys,
Windex thank you for your effort in making this post. I'm working through it now. - Altera_Forum
Honored Contributor
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.- 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?
- 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.
- 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?
- 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?
- Altera_Forum
Honored Contributor
Any luck with this, I'm trying to do a similar project.
- Altera_Forum
Honored Contributor
basically i dropped the webserver example and went for the simple socket example. I'll explain further in my topic here:
http://www.alteraforum.com/forum/showthread.php?t=28577 - Altera_Forum
Honored Contributor
Hi Windex
I try your support a methods[/U] [/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 ...
- Altera_Forum
Honored Contributor
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.