Forum Discussion
Altera_Forum
Honored Contributor
16 years agoSimple Socket Server on DE2 w/Davicom DM9000A
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!98 Replies
- Altera_Forum
Honored Contributor
Hi tnn design,
I try to ping the board, but no response from my PC. Telnet also not working. Do you have any idea what happen here? I use wireshack to check the LAN connection. There is no data coming out from the DE2 board. Can you give me some hint how i should debug from here? Thanks. - Altera_Forum
Honored Contributor
Hi,i have a problem that i can't download the file DE2_SimpleSocketServer.zip,it says that the download now is unavilable
could you send me a copy to the mail"[email protected]",thank you in advance - Altera_Forum
Honored Contributor
I can't download the file:"DE2_SimpleSocketServer.zip".
May you send me an email that include the file. My email is :[email protected] Thank you ! - Altera_Forum
Honored Contributor
I can't download the file:"DE2_SimpleSocketServer.zip".
May you send me an email that include the file. My email is :[email protected] Thank you ! - Altera_Forum
Honored Contributor
--- Quote Start --- Just a couple of responses to your questions. Congratulations "cafukarfoo". You are definately are on the right track. The fact your DE2 board is acquiring an IP over DHCP means the ethernet connection is up and operational. Remember...you can only telnet into the board when a server socket is setup and listening on a particular protocol/port. Try testing your SSS by pinging the DE2 board. If the board reply's to a ICMP packet (ping), then everthing is working and ready for you to implement socket comms. Well done also to "shenlung". I believe you can access the link status through a memory register on the Davicom DM9000A controller device. You will need to check the datasheet and modify the ethernet driver accordingly. A few notes also to those who have asked: - Yes, project was build on Quartus Web edition. - Once running, found the SSS to be extremely stable. Wrote a C library to facilitate socket comms between the DE2 and a Win32 console app. Found the link to be stable and capable of transferring a large amount of data between the DE2<-->PC with no errors. --- Quote End --- Good day tnndesign thanks for your comment. I did not implement as part of driver, I implemented a task to read the PHY. This worked except occasionally would lock up the socket communication, I initially had the task priority at a lower number than the simple socket server task, but it occurred to me perhaps the PHY task was being executed mid low level driver activity, mucking up the driver, so I changed the task priority number above the SSS task. It now appears to work but I will test it more. This obviously is not implemented at the driver level but I would like to do so as you suggested. What is involved to implement at the driver level yet keep the function from clobbering the socket communication. Thanks shenlung # define LINK_DOWN ((Enables & 0xc) | 0x1) # define LINK_UP ((Enables & 0xc) | 0x2) void SSSMonitorPhyTask(void *task_data) { INT16U status; int disconnect_count; int data; int Enables; disconnect_count=0; while(1) { /* Run task once a second */ OSTimeDlyHMSM(0,0,1,0); /* Read PHY */ data = 0x41; /* PHY Regester offset into EPAR Bit 4..0, PHY address into EPAR Bit 7..6 */ dm9000a_iow(0xC, data); /* write to dm9000a */ usleep(5); /* 5uS max delay */ data = 0x0c; /* Write 0x0c into EPCR reg 0x08 to start PHY + READ operation */ dm9000a_iow(0xb, data); usleep(5); data = 0x08; /* Write 0x08 into EPCR reg 0x0b to clear READ command */ dm9000a_iow(0xb, data); usleep(5); status = dm9000a_ior(0xd); /* Read PHY low byte from EPDRL reg */ printf("\n%x\n", status); if(!(status & 0x4)) //Link Down set front panel LED red { Enables = IORD_ALTERA_AVALON_PIO_DATA(PIO_ENABLES_BASE); /* Set BiColor LED red */ IOWR_ALTERA_AVALON_PIO_DATA(PIO_ENABLES_BASE, LINK_DOWN); disconnect_count++; if(disconnect_count > MAX_CABLE_DOWN ) { printf("\nPHY ERROR: Ethernet Cable Disconnected!\n"); } } else // Link Good set front panel LED Green { Enables = IORD_ALTERA_AVALON_PIO_DATA(PIO_ENABLES_BASE); IOWR_ALTERA_AVALON_PIO_DATA(PIO_ENABLES_BASE, LINK_UP); } } } - Altera_Forum
Honored Contributor
hi
I can't download the file:"DE2_SimpleSocketServer.zip". Media fire link is damaged too. May you send me an email that include the file. My email is :[email protected] Thank you !! - Altera_Forum
Honored Contributor
I can't download the file:"DE2_SimpleSocketServer.zip".
May you send me an email that include the file. My email is :[email protected] Thank you !! - Altera_Forum
Honored Contributor
I have the same problem .....
I can't download neither the file:"DE2_SimpleSocketServer.zip" or VOIP.tgz Could someone send me an email that include the file(s). My email is : piripispulo AT cekanet.com Please, replace AT with @. Thank you !! - Altera_Forum
Honored Contributor
execuse me,would you please give me your successful project,I am a new comer,thankyou very much,my email:[email protected],[email protected]
- Altera_Forum
Honored Contributor
--- Quote Start --- Enjoy................................... http://www.mediafire.com/?75wlgv51dyhqq56 this is the original zip file shared by tnnDesign regards hasi86 --- Quote End --- link is not available . kindly upload again