Forum Discussion
Altera_Forum
Honored Contributor
10 years agoHelp: Simple Socket Server - Stratix IV GX
Hello,
I have a very basic knowledge on FPGAs and Verilog, as I only started to learn about it this semester. my final year project is quite big as I have to implement a PoE structure then make connection with the FPGa board then finally adding a sensor to system. For now I needs to build a simple socket server work on my FPGA board Stratix IV. I have looked through the forum and found this article, which explains nicely on how to build one http://www.alteraforum.com/forum/showthread.php?t=28837 but there are things that I did not understand because of different board. what does this mean (DE2_115_WEB_SERVER_RGMII_ENET0 demo) ad where can I find the demo that is suitable for my board. honestly I don't know where to start, please any guidelines will really be helpful . Thanks You27 Replies
- Altera_Forum
Honored Contributor
Look on the web site of the company that made your demo board. They should have examples suitable for your board.
- Altera_Forum
Honored Contributor
@Galfonz
I have used the web server file of the Stratix IV and I just wanted to run the Qsys file and generate it but it gives me an error though I did not change anything, knowing that the file was for version 12 but it says it can be used in letter versions also, the error is Error: eth_std_main_system.ethernet_subsystem.tse_mac: Component triple_speed_ethernet 12.0 not found or could not be instantiated my version is Quartus 15 all other components written used (version 15 instead of 12), but I did not find this component. Am new in it please guide me thank you - Altera_Forum
Honored Contributor
hi,
it means that the triple speed eth 12.0 is out of date so you ll have to instantiate the newest version from qsys (quartus2 15.0 related) and make the connexions by yourself. in the search bar, look for triple speed ethernet. - Altera_Forum
Honored Contributor
--- Quote Start --- hi, it means that the triple speed eth 12.0 is out of date so you ll have to instantiate the newest version from qsys (quartus2 15.0 related) and make the connexions by yourself. in the search bar, look for triple speed ethernet. --- Quote End --- Hi I have managed to make everything work but it seems that packets are sent from the FPGA but nothing is received... !! what will possibly be wrong ? I used Putty software using Telnet connection in port 30 but nothing seems to appear. though I have no error in the program please advice - Altera_Forum
Honored Contributor
does a ping responds at least?
- Altera_Forum
Honored Contributor
--- Quote Start --- does a ping responds at least? --- Quote End --- No even the ping does not respond !! - Altera_Forum
Honored Contributor
post your hdl code please so i can try to help.
- Altera_Forum
Honored Contributor
--- Quote Start --- post your hdl code please so i can try to help. --- Quote End --- when I run the software this is what I get ------------------------------------------------------------------------------------------------------------------------------------------------- https://www.alteraforum.com/forum/attachment.php?attachmentid=12398 ------------------------------------------------------------------------------------------------------------------------------------------------- Your Ethernet MAC address is 00:07:ed:ff:6b:c7 prepped 1 interface, initializing... [tse_mac_init] INFO : TSE MAC 0 found at address 0x0800a000 INFO : PHY Marvell 88E1111 found at PHY address 0x00 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 : PCS[0.0] - Configuring PCS operating mode INFO : PCS[0.0] - PCS SGMII mode disabled 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 : 0.0.0.0 ------------------------------------------------------------------------------------------------------------------------------------------------- I don't understand why am I getting that IP address, the software am running is from altera hardware example designs this is the code that is specifically for the IP address portion ------------------------------------------------------------------------------------------------------------------------------------------------- * In our system, we are either attempting DHCP auto-negotiation of IP address, * or we are setting our own static IP, Gateway, and Subnet Mask addresses our * self. This routine is where that happens. */ int get_ip_addr(alt_iniche_dev *p_dev, ip_addr* ipaddr, ip_addr* netmask, ip_addr* gw, int* use_dhcp) { IP4_ADDR(*ipaddr, IPADDR0, IPADDR1, IPADDR2, IPADDR3); IP4_ADDR(*gw, GWADDR0, GWADDR1, GWADDR2, GWADDR3); IP4_ADDR(*netmask, MSKADDR0, MSKADDR1, MSKADDR2, MSKADDR3); # ifdef DHCP_CLIENT *use_dhcp = 1; # else /* not DHCP_CLIENT */ *use_dhcp = 0; printf("Static IP Address is %d.%d.%d.%d\n", ip4_addr1(*ipaddr), ip4_addr2(*ipaddr), ip4_addr3(*ipaddr), ip4_addr4(*ipaddr)); # endif /* not DHCP_CLIENT */ /* Non-standard API: return 1 for success */ return 1; } ------------------------------------------------------------------------------------------------------------------------------------------------- Another thing that the software asks for the serial number to generate the mac address I couldnt find the serial number on the box so I just enetered random " 111111111111111" number. So what can I do with the IP address or should i eneter it manually since its a static IP ? - Altera_Forum
Honored Contributor
1-is the FPGA connected to a switch or directly to your pc?
2-if it s connected to a switch, ask your admin to give you a mac address related to a IP/DHCP, he will it give to you. 3- GO Qsys and disable PCS options in tse, since you re using an external phy 4- For mac address in software, this example assumes you have this info in an external flash, but you can override it with this (network_utilities.c):
replace with mac address you get from your sys admin. the problem should be resolved thenerror_t get_board_mac_addr(unsigned char mac_addr) { error_t error = 0; alt_u32 signature; mac_addr = 0x00; mac_addr = 0x07; mac_addr = 0xED; mac_addr = 0xFF; mac_addr = 0x0C; mac_addr = 0x83; return error; } - Altera_Forum
Honored Contributor
My FPGA is connected directly to PC, so am not using any DHCP client.
do I have to disable the tse if its connected directly ? and about the mac address do I replace the whole code of that part (error_t get_board_mac_addr(unsigned char mac_addr[6])