Intel® FPGA University Program
University Program Material, Education Boards, and Laboratory Exercises
1174 Discussions

Simple Socket Server on DE2 w/Davicom DM9000A

Altera_Forum
Honored Contributor II
4,855 Views

updated. 

Altera's Simple Socket Server demo running on a DE2 board with the Davicom DM9000a driver. 

 

here it is....zipped downloaded project source for sss on the de2 board. 

download link currently unavailable. 

 

Includes: 

- Hardware design (TLD in schematic block diagram format) 

- Programmable .SOF (time-limited, as developed in Quartus Web Edition v9.2) 

- SOPC builder system file 

- DM9000A driver for Nichestack TCP/IP stack / Altera HAL environment (courtesy of Columbia Uni) 

- Simple socket server software 

 

Simply... 

- (1) Download the .SOF in Quartus Programmer 

 

- (2) Open the software workspace in the "/software" directory in Nios II Build Tools (Eclipse IDE) 

 

- (3) Open Run >> Run Configurations. Delete the current configuration. Create a new launch configuration selecting the project name under the Project Tab. Ensure your DE2 board is plugged into USB. Check the target connection tab and make sure it is present. 

 

- (4) Plug into your local network (DHCP is enabled, or app will default to static IP) 

 

- (5) View the Nios II console for debugging information (via JTAG UART) 

 

- (6) Telnet into the board from a pc: telnet <ip address> 30. Enjoy the simple socket server demo from Altera! 

 

Questions/comments? Fire away below!
0 Kudos
98 Replies
Altera_Forum
Honored Contributor II
592 Views

Are you running DHCP to a switch?...or, better still, to a DHCP server that you have access to? That way you can see (or not) the packets that your board is generating. Of course, if you are statically assigning IPs then that doesn't apply. 

 

Simply hangs doesn't really help me to help you much. What happens if you Debug the code and step through it to see where it's actually hanging? 

 

So...throw me some more info and I'll see if I can help. 

 

Cheers, and Good luck... 

 

--slacker
0 Kudos
Altera_Forum
Honored Contributor II
592 Views

Please refer to the following links to the VOIP project @ Columbia Uni. 

I have sourced the DM9000a SOPC component + Nichestack driver from this project. 

 

http://www1.cs.columbia.edu/~sedwards/classes/2009/4840/reports/voip.pdf (http://www1.cs.columbia.edu/~sedwards/classes/2009/4840/reports/vp.pdf

http://www1.cs.columbia.edu/~sedwards/classes/2009/4840/reports/voip.tar.gz
0 Kudos
Altera_Forum
Honored Contributor II
592 Views

Well, I haven't got much time tonight to post, but in short....i have now the simple socket server running on the de2 board! 

 

It works - telnet works, ping works...and using the Davicom DM9000a controller which Altera provide no inherent support for. 

 

All credit to Columbia Uni for their Nichestack driver, which I can now confirm works successfully. Hardware design was a little more tricky, integrating the Simple Socket server reference design and DM9000a hardware/HAL/uCOS driver on the DE2, but will post back soon with detailed instructions on how I got it all working. 

 

But the good news here is, it can be done! Will post up working source/code for this soon. Hurrah! Hurray!
0 Kudos
Altera_Forum
Honored Contributor II
592 Views

Hi, 

 

can u post how you solved that problem ? 

 

I'm currently working with NicheStack and Nios IDE 8.0SP1 and the Simple Socket Server Example compiles just fine. I can ping my devboard and connect to the socket server via telnet. But after a few Minutes the whole thing just seems to hang itself up ... No response to pings from then on. Can anybody help with this issue?
0 Kudos
Altera_Forum
Honored Contributor II
592 Views

here it is....zipped downloaded project source for sss on the de2 board. 

download link currently unavailable. 

 

Includes: 

- Hardware design (TLD in schematic block diagram format) 

- Programmable .SOF (time-limited, as developed in Quartus Web Edition v9.2) 

- SOPC builder system file 

- DM9000A driver for Nichestack TCP/IP stack / Altera HAL environment (courtesy of Columbia Uni) 

- Simple socket server software 

 

Simply... 

- (1) Download the .SOF in Quartus Programmer 

 

- (2) Open the software workspace in the "/software" directory in Nios II Build Tools (Eclipse IDE) 

 

- (3) Open Run >> Run Configurations. Delete the current configuration. Create a new launch configuration selecting the project name under the Project Tab. Ensure your DE2 board is plugged into USB. Check the target connection tab and make sure it is present. 

 

- (4) Plug into your local network (DHCP is enabled, or app will default to static IP) 

 

- (5) View the Nios II console for debugging information (via JTAG UART) 

 

- (6) Telnet into the board from a pc: telnet <ip address> 30. Enjoy the simple socket server demo from Altera! 

 

Questions/comments? Fire away below!
0 Kudos
Altera_Forum
Honored Contributor II
592 Views

Hi can you explain the second step (open the software workspace...) more detailed? Thanks 

 

I get the message by downloading on Nios" 'Launching ethernet NIOS II Hardware configuration' has encountered a problem. Downloading Elf Proceess failed"
0 Kudos
Altera_Forum
Honored Contributor II
592 Views

Hi Catmoe. Have just revised the instructions. (See above). 

 

Make sure you follow Step (3), otherwise you may experience failure due to mismatched system timestamp/ID. 

 

Also, if you're not using DHCP, you can disable in the BSP settings for Nichestack. But the app should auto-default to a static IP anyway, so this shouldn't be a problem. 

 

If all goes well, you should see in the console the program being loaded into SDRAM, verified and then in the Nios II console on the right of your screen, you should see the Nichestack initialisation and the debug output from the socket server program. 

 

Let me know how you get on with that!
0 Kudos
Altera_Forum
Honored Contributor II
592 Views

 

--- Quote Start ---  

here it is....zipped downloaded project source for sss on the de2 board. 

http://www.tnndesign.com/ee/fpga/de2_simplesocketserver.zip 

 

Includes: 

- Hardware design (TLD in schematic block diagram format) 

- Programmable .SOF (time-limited, as developed in Quartus Web Edition v9.2) 

- SOPC builder system file 

- DM9000A driver for Nichestack TCP/IP stack / Altera HAL environment (courtesy of Columbia Uni) 

- Simple socket server software 

 

Simply... 

- (1) Download the .SOF in Quartus Programmer 

 

- (2) Open the software workspace in the "/software" directory in Nios II Build Tools (Eclipse IDE) 

 

- (3) Open Run >> Run Configurations. Delete the current configuration. Create a new launch configuration selecting the project name under the Project Tab. Ensure your DE2 board is plugged into USB. Check the target connection tab and make sure it is present. 

 

- (4) Plug into your local network (DHCP is enabled, or app will default to static IP) 

 

- (5) View the Nios II console for debugging information (via JTAG UART) 

 

- (6) Telnet into the board from a pc: telnet <ip address> 30. Enjoy the simple socket server demo from Altera! 

 

Questions/comments? Fire away below! 

--- Quote End ---  

 

 

hey,i have some problems to download the code,i have tried many times but not successed,can you send it to my e-mail,i'll be appreaited! 

my email :kediqun.123@163.com
0 Kudos
Altera_Forum
Honored Contributor II
592 Views

Just a wee note for those who have tried it and are having problems. As an alternative (if Nios II Built Tools for Eclipse is not liking the project directory structure)... 

 

- Delete the /software directory from the main project directory 

- Create a new application/BSP from the given examples and select "Simple Socket Server" from the available list. Point to the .SOPCINFO file in the project directory 

- Let the IDE create the project and the BSP incl all necessary HAL drivers etc 

- Build the project, and the program to the DE2 

- The project should build with the default ref design (all the components in SOPC builded required in the example are present). 

 

Anyone who has trouble running it PM me and I'd be happy to give you a hand.
0 Kudos
Altera_Forum
Honored Contributor II
592 Views

Ok When i open IDE Eclipse, i select a workspace ( i created a new workspace) when the platform opens i choose File -> new -> Nios II Aplication and BSP from Template. Then i select the sopcinfo file , which was in the zip-order and choose an Projectname (ethernetconnection) and choose simple socket server and 'finish'. then run -> run configurations-> NIOS II HARDware-> new configuration and selcet the Projectname( ethernetconnection). but under Elf File name there is no object which you can select, there is only an empty field. so i cant run the project. have i forgotten something? or how can i solve this problem?

0 Kudos
Altera_Forum
Honored Contributor II
592 Views

 

--- Quote Start ---  

Ok When i open IDE Eclipse, i select a workspace ( i created a new workspace) when the platform opens i choose File -> new -> Nios II Aplication and BSP from Template. Then i select the sopcinfo file , which was in the zip-order and choose an Projectname (ethernetconnection) and choose simple socket server and 'finish'. then run -> run configurations-> NIOS II HARDware-> new configuration and selcet the Projectname( ethernetconnection). but under Elf File name there is no object which you can select, there is only an empty field. so i cant run the project. have i forgotten something? or how can i solve this problem? 

--- Quote End ---  

 

 

Make sure you have successfully built the project first!  

Sounds like the ELF is missing as the project hasn't been built. Normally if you just hit Run, the project is built prior to deploying to your Nios processor.
0 Kudos
Altera_Forum
Honored Contributor II
592 Views

ok i can choose the ELF, but when i click run i get the masseage ' download elf process failed' and on the console :Verify failed between address 0x800000 and 0x80FFFF

0 Kudos
Altera_Forum
Honored Contributor II
592 Views

 

--- Quote Start ---  

ok i can choose the ELF, but when i click run i get the masseage ' download elf process failed' and on the console :Verify failed between address 0x800000 and 0x80FFFF 

--- Quote End ---  

 

 

Are you able to post a screenshot of the console/showing the error?
0 Kudos
Altera_Forum
Honored Contributor II
592 Views

hey,tnndesign 

i use DM9000+LWIP+UCOS,but U know the NIOS II IDE'LWIP just support the lan91c111 ,how can i use the DM9000 with LWIP,AND the your NICHESTACK must the same with me, but how you solve it? thanks
0 Kudos
Altera_Forum
Honored Contributor II
592 Views

ok i get this message every time i try to run the programm

0 Kudos
Altera_Forum
Honored Contributor II
592 Views

 

--- Quote Start ---  

hey,tnndesign 

i use DM9000+LWIP+UCOS,but U know the NIOS II IDE'LWIP just support the lan91c111 ,how can i use the DM9000 with LWIP,AND the your NICHESTACK must the same with me, but how you solve it? thanks 

--- Quote End ---  

 

 

Dison. 

I'm using the DM9000a controller with the latest Nichestack TCP/IP library provided by Altera. I believe LWIP was supported in a prev version of the Nios Tools Suite, however Altera have since moved to the Micrium uCOS/OS-II + Nichestack platform combination for TCP/IP. 

 

If you are running a previous version of the Nios Design Tool and/or you would like to use LWIP, check out the DE2_WEB example from Terrasic. They include a custom-written driver for the DM9000a for use with LWIP. 

 

The solution I have posted is for use with the latest Altera ref design for a simple socket server. It provides DM9000a driver support for use w/Nichestack.
0 Kudos
Altera_Forum
Honored Contributor II
592 Views

 

--- Quote Start ---  

ok i get this message every time i try to run the programm 

--- Quote End ---  

 

 

Certainly unusual. If I didn't know better, would say this is a timing issue, but as long as you are using the SOF file in the Quartus directory you shouldn't be having any trouble. Program memory is set to the SDRAM chip which requires a PLL to compensate for clock skew (approx -3ns shift). This is already included in the H/W design files. 

 

When you program the "time-limited" SOF in Quartus Programmer, are you able to successfully program the configuration into the FPGA over JTAG? Does the Opencore IP Evaluation popup open and say "Time Remaining: Unlimited"?
0 Kudos
Altera_Forum
Honored Contributor II
592 Views

Sorry i didn´t answer i was on holiday. There is an error when i use the time-limited-sof: 

"Error: Can't communicate with device. Device will stop functioning when it reaches its non-tethered mode timeout limit." But i don´t know how to handle it, the device has power and the usb-blaster cable works, too. 

But when i use the other NiosIIfDesign-Sof (not time limtied) there is no error in Quartus but the error in Nios by downloading the elf-process is still there.
0 Kudos
Altera_Forum
Honored Contributor II
592 Views

That's your problem right there - due to the time-limited features used in the SOPC design, the Opencore IP popup must stay open otherwise you'll encounter errors downloading the ELF file. 

 

Make sure you are running Quartus 9.1SP2 (Web Edition) and NIOS II EDS 9.1. Try rebuilding the Quartus Project to regenerate the SOF. Everything builds and downloads successfully in 9.1SP2 which I am using - so there shouldn't be any problem there.
0 Kudos
Altera_Forum
Honored Contributor II
566 Views

Oh i have the smsc lan91c111 on my board so i can´t take the dm9000a which you have used, right?

0 Kudos
Reply