Nios® V/II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® V/II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++
12606 Discussions

simple socket server connection established, but cannot ping/telnet

Altera_Forum
Honored Contributor II
5,509 Views

hello guys, 

 

I got a problem with simple socket server problem. I post similiar thread in dev kit forum, but no answer until now. I am thinking maybe I could get help from here. Thank you in advance. 

 

 

My situation is here: 

 

hardware: cIII 120 develop board 

software: QII 9.1 sp2, Nios II 9.1 sp2 

 

What i have done: 

1. copy the C:\altera\91\nios2eds\examples\verilog\niosII_cycl oneIII_3c120\triple_speed_ethernet_design to my project fold and open with QII 

2. open sopc builder and run generate 

3. back to QII and compile to generate sof (time limited version) 

4. open nios eclipse ide, create a new project with simple socket server template 

5. to avoid troulbe, modife get_mac_addr() as: 

****************************************** 

int get_mac_addr(NET net, unsigned char mac_addr[6]) 

mac_addr[0]=0xB7; 

mac_addr[1]=0xA7; 

mac_addr[2]=0xED; 

mac_addr[3]=0xFF; 

mac_addr[4]=0xFF; 

mac_addr[5]=0xFF; 

return 0; 

// return (get_board_mac_addr(mac_addr)); 

****************************************** 

6. I disable DHCP in wizard and I use cross cable to connect board and PC directly. 

 

7. run app as "Nios II hardware" 

 

what I got: 

 

=============== Software License Reminder ================ 

This software project uses an unlicensed version of the NicheStack TCP/IP 

Network Stack - Nios II Edition. If you want to ship resulting object 

code in your product, you must purchase a license for this software from 

Altera. For information go to: "http://www.altera.com/nichestack

================================================== === 

InterNiche Portable TCP/IP, v3.1  

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

prep_tse_mac 0 

Static IP Address is 192.168.1.234 

prepped 1 interface, initializing... 

[tse_mac_init] 

INFO : TSE MAC 0 found at address 0x08004000 

INFO : PHY Marvell 88E1111 found at PHY address 0x12 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 = 100, Duplex = Full 

OK, x=1, CMD_CONFIG=0x00000000 

MAC post-initialization: CMD_CONFIG=0x04000203 

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

mctest init called 

IP address of et1 : 192.168.1.234 

Created "Inet main" task (Prio: 2) 

Created "clock tick" task (Prio: 3) 

Simple Socket Server starting up 

[sss_task] Simple Socket Server listening on port 30 

Created "simple socket server" task (Prio: 4) 

 

 

Everything looks smooth, but I cannot ping, telnet or whatever else. 

When I ping, the RX light is flashing, but TX light not.
0 Kudos
43 Replies
Altera_Forum
Honored Contributor II
2,067 Views

The output log shows that apparently everything is ok: 

- application is running 

- ethernet link is established and nios is aware of it 

- tcp/ip stack has started and is operating 

- server ip address has been assigned 

- your application has started too and it is waiting a connection 

 

A few basic (and maybe silly) questions: 

- is your client (PC) configured with the correct subnet 

- is your application still running or is it stuck somewhere? 

- have you already made any debug? I mean, has the server application returned from the select() call?
0 Kudos
Altera_Forum
Honored Contributor II
2,067 Views

 

--- Quote Start ---  

The output log shows that apparently everything is ok: 

- application is running 

- ethernet link is established and nios is aware of it 

- tcp/ip stack has started and is operating 

- server ip address has been assigned 

- your application has started too and it is waiting a connection 

 

A few basic (and maybe silly) questions: 

- is your client (PC) configured with the correct subnet 

- is your application still running or is it stuck somewhere? 

- have you already made any debug? I mean, has the server application returned from the select() call? 

--- Quote End ---  

 

 

 

hi SIELASER, 

thank you so much for reply. 

 

my client PC is configred as: 

static IP: 192.168.1.235 

subnet: 255.255.255.0 

Default gateway: 192.168.1.1 

 

Board is configred as:# define IPADDR0 192# define IPADDR1 168# define IPADDR2 1# define IPADDR3 234# define GWADDR0 192# define GWADDR1 168# define GWADDR2 1# define GWADDR3 1# define MSKADDR0 255# define MSKADDR1 255# define MSKADDR2 255# define MSKADDR3 0 

 

I used cross cable to connect them directly. 

I did  

1. load sof to board(it is a timelimited file recated by QII) 

2. from IDE, load server application by "run as Nios II hardware" 

 

after load and print info to IDE, 

the server is waitting there. 

 

Then I try to ping from pc command line, by  

ping 192.168.1.234 

I found the RX light blink sometime, but TX is quiet. 

 

the server looks still waitting, nothing happen. 

after a while, ping is failed 

 

No, I didn't do any debug, no return from select() call, the sever is just waitting 

 

(http://www.alteraforum.com/forum/member.php?u=30040)
0 Kudos
Altera_Forum
Honored Contributor II
2,067 Views

This shows that everything is ok up to the phy level. 

So you don't have any problem with ethernet link or cable. 

The problem can be due to the MAC, the sgdma or even the tcp stack. 

This is strange if you simply rebuilt a ready made reference design, without any change (this is what I think you did; is it correct?) 

I use a different dev board so I don't know if there is any hardware issue with yours. 

The only suggestion I can now think is that you can exclude tcp stack and check if raw ethernet frames are received: in the tse driver there is a function where all ethernet data is passing through. Unfortunately I can't remember its name; try locating arp_recv (or something like that), place a breakpoint in debug mode and then go backward until you find a function which filters some data. 

If you possibly find that no raw frame is received you have a problem with mac or sgdma configuration. 

 

One last idea: 

I see now that you are using a time limited version of sof file. Maybe you are using the OpenCore tse? In this case you should keep the connection with the programmer open or the tse core will stop working: don't close the reminder message box which appears after fpga configuration 

 

Regards
0 Kudos
Altera_Forum
Honored Contributor II
2,067 Views

I have the same problem with you,dubuging server weeks but without any result,have you find the selution ? 

 

--- Quote Start ---  

hi SIELASER, 

thank you so much for reply. 

 

my client PC is configred as: 

static IP: 192.168.1.235 

subnet: 255.255.255.0 

Default gateway: 192.168.1.1 

 

Board is configred as:# define IPADDR0 192# define IPADDR1 168# define IPADDR2 1# define IPADDR3 234# define GWADDR0 192# define GWADDR1 168# define GWADDR2 1# define GWADDR3 1# define MSKADDR0 255# define MSKADDR1 255# define MSKADDR2 255# define MSKADDR3 0 

 

I used cross cable to connect them directly. 

I did  

1. load sof to board(it is a timelimited file recated by QII) 

2. from IDE, load server application by "run as Nios II hardware" 

 

after load and print info to IDE, 

the server is waitting there. 

 

Then I try to ping from pc command line, by  

ping 192.168.1.234 

I found the RX light blink sometime, but TX is quiet. 

 

the server looks still waitting, nothing happen. 

after a while, ping is failed 

 

No, I didn't do any debug, no return from select() call, the sever is just waitting 

 

 

--- Quote End ---  

0 Kudos
Altera_Forum
Honored Contributor II
2,067 Views

maybe you forgot to enable the GMII interface. 

try to add following code in the ins_tse_mac.c 

 

marvell_cfg_gmii(tse[iface].mi.base);
0 Kudos
Altera_Forum
Honored Contributor II
2,067 Views

I have the same problem! :confused: 

Has anyone found a solution?
0 Kudos
Altera_Forum
Honored Contributor II
2,067 Views

I had the same problem using the board DMB3c40. I have a project with the next settings: 

 

QuartusII 8.0 sp1 

NIOS EDS 8.0 

NIOS FAST 

TSE_MAC 10_100 

simple_sockect_server sending video by using UDP sockets 

 

To solve this problem I had to change the setting Speed in my NIC card: 

 

I set: speed=100Mbits full duplex instead of 'autonegotiation' 

 

After this data were sent
0 Kudos
Altera_Forum
Honored Contributor II
2,067 Views

I am having the same problem using the Cyclone III Starter Board (3c25) and the HSMC-NET Daughter card.  

If I run the demo batch file (which installs the .sof and .elf file that came with the daughter card) then I can connect to the socket as shown in the tutorial. 

However if I compile the project myself (SOPC, then Quartus, then NIOS II EDS), it connects in the same way and the output on the NIOS console is identical, but I get no response when pinging the IP address and I cannot connect to the socket. 

I have tried this using Quartus and Nios versions 8, 9.1 and 10. Same results every time. 

 

Help please!!!!
0 Kudos
Altera_Forum
Honored Contributor II
2,067 Views

try Quartus 9.0 & IDE 

if it doesnt work, try to add your own .sdc file to constraint tx & rx clk.
0 Kudos
Altera_Forum
Honored Contributor II
2,067 Views

Ok thanks. I'll download it and give it a shot.  

Please be more specific with what I should do with the .sdc file? I'm quite new to the timing constraint side of things. 

 

Forgot to add to my original post:  

I contacted Terasic about this issue, and told them how I went about Generating system in SOPC Builder, Compiling in Quartus 10 and then using Nios EDS 10. They said they tried the same thing and it worked perfectly for them. Really strange.
0 Kudos
Altera_Forum
Honored Contributor II
2,067 Views

Terasic have managed to fix my problem. 

They supplied this file which allows for compilation in Quartus and SOPC Builder 10.0 SP1. 

 

In Nios II EDS 10.0, I created a Simple Socket Server example as per the .SOPCINFO file generated from the downloaded files. 

I then had to copy the files from the QB3/QB3_NET_GMII_NET0/software/ethernet_test/simple_socket_server to overwrite the files in my project. I applied the changes as per the HSMC-NET user manual, and finally it works!
0 Kudos
Altera_Forum
Honored Contributor II
2,067 Views

I'm glad that you've fixed your problem. 

have you compared the files they gave you with your own? 

is it about the marvell_cfg_gmii?
0 Kudos
Altera_Forum
Honored Contributor II
2,067 Views

I compared most of the .v files (to compare the hardware) and most of the .c files (to compare the software) and cannot seem to find any differences. 

I added the "marvell_cfg_gmii(tse[iface].mi.base);" line to both ins_tse_mac.c files in both projects, so the difference isn't there.
0 Kudos
Altera_Forum
Honored Contributor II
2,067 Views

just an fyi ... i've been fighting this problem for most of the morning. the suggestion made by 

seilaser did the trick. i simply left the quartus-ii programmer open and i can ping as well as run the telnet example.  

 

/david
0 Kudos
Altera_Forum
Honored Contributor II
2,067 Views

Hi guys, 

I am also facing the same problem. 

I am using Arria II GX FPGA on my custom board. Marvell 88E1111 PHY, TSE MAC and RGMII 

I m using version 10.1 

 

I am not able ping the custom board. 

 

@t.yuan 

Where exactly shall I include 

"marvell_cfg_gmii(tse[iface].mi.base);" 

in 

ins_tse_mac.c 

 

my interface standard is RGMII 

 

 

@BenjaminLunsky 

What exactly u did? 

can u elaborate? 

What files you got from Terasic? 

can u please tell me? 

 

 

URGENT !!!!!!
0 Kudos
Altera_Forum
Honored Contributor II
2,067 Views

Hi all, 

 

I am having the same problem using my custom board with national Dp83865 PHY. 

 

once running the console displays: 

 

 

--- Quote Start ---  

 

InterNiche Portable TCP/IP, v3.1  

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

prep_tse_mac 0 

Your Ethernet MAC address is a0:a0:a0:a0:a0:a0 

Static IP Address is 192.168.1.16 

prepped 1 interface, initializing... 

[tse_mac_init] 

SGDMA desc memory cleared  

INFO : TSE MAC 0 found at address 0x08005c00 

INFO : PHY National DP83865 found at PHY address 0x02 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] - 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] - Gigabit = 0, Duplex = Full 

OK, x=2, CMD_CONFIG=0x01000000 

MAC post-initialization: CMD_CONFIG=0x05000203 

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

IP address of et1 : 192.168.1.16 

Created "Inet main" task (Prio: 2) 

Created "clock tick" task (Prio: 3) 

Simple Socket Server starting up 

[sss_task] Simple Socket Server listening on port 30 

Created "simple socket server" task (Prio: 4) 

 

--- Quote End ---  

 

 

after Created "simple socket server" task (Prio: 4),I can't ping the custom board. 

 

Anyone has an idea of how to debug this problem? 

 

Help would be greatly appreciated! 

 

Thanks, 

Xiyou 

0 Kudos
Altera_Forum
Honored Contributor II
2,067 Views

 

--- Quote Start ---  

Hi guys, 

I am also facing the same problem. 

I am using Arria II GX FPGA on my custom board. Marvell 88E1111 PHY, TSE MAC and RGMII 

I m using version 10.1 

 

I am not able ping the custom board. 

 

@t.yuan 

Where exactly shall I include 

"marvell_cfg_gmii(tse[iface].mi.base);" 

in 

ins_tse_mac.c 

 

my interface standard is RGMII 

 

 

@BenjaminLunsky 

What exactly u did? 

can u elaborate? 

What files you got from Terasic? 

can u please tell me? 

 

 

URGENT !!!!!! 

--- Quote End ---  

 

Hi,all, 

I also have the same problem with arria ii gx board of altera, 

please help me.
0 Kudos
Altera_Forum
Honored Contributor II
2,067 Views

Hi, 

I am using Arria II GX FPGA on my custom board. 

Marvell 88E1111 PHY, TSE MAC and RGMII 

I m using Quartus version 10.1 

 

I am trying to run Simple Socket Server with RGMII mode on my custom board. 

I am able to ping my custom board with th IP address I configured on it. 

 

But connection establishment between client and server is not happening 

Do I need to include 

marvell_cfg_rgmii(tse[iface].mi.base); 

in 

ins_tse_mac.c 

 

Where exactly shall I include "marvell_cfg_gmii(tse[iface].mi.base);" 

in ins_tse_mac.c 

 

What can be other possible solution?
0 Kudos
Altera_Forum
Honored Contributor II
2,067 Views

If you can ping the board, there's definitely no problem at the mac/phy levels, so I don't think you need to include that. 

Probably you have a wrong SSS code or made a mistake in tcp configuration: infact ping relies on UDP, while the server-client connection requires TCP which is a bit more complex. 

Using a network analyzer like Wireshark can easily help you to find out if connection initiates and where it fails before being established.
0 Kudos
Altera_Forum
Honored Contributor II
1,871 Views

@Cris72 

 

I tried to rum same SSS code on Arria II GX development kit. 

It's running there on dev kit
0 Kudos
Reply