W5500 is running ok,but link PC directly the ping timeout is big (20 ms) and the throughout is just 1Mbps

What is the value or MR register in common register block?

it is 0x14

soc is mt6755(android 6).
spi speed is 1Mbps

socket moe reg is 0x94 AND status reg is 0x42.
I print this regs after wiznet open operation…

Are you taking about MR register in common register block? Bit 2 is said to be “reserved” in it, not sure why it is set in your case. I think your 0x14 is socket’s MR, not common one.

Anyway, for W5500 to respond to ping requests bit 4 should be reset (as per datasheet “ping block is disabled”), ensure that on chip initialization you write 0x80 to perform software reset, then wait until its bit 7 reset (software reset completion), and do not write anything else in there (ping responding is enabled by default).

i have done as you said ,
now ,the MR reg is 0x00,
but still i cannot ping with my pc…

BTW, does spi speed influence ping operation ??

THE green led is always bright and the yellow one is blinked when i connect it with my pc

thx

Do you connect P2P with your PC? How your PC’s network interface is configured? How W5500 is configured?

I do not think so if W5500 is seen properly from the SPI side. However there’s always a possibility that you configure chip in wrong way.

hello Eugeny
i set my pc a fixed ip addr as 192.168.2.55 netmask 255.255.255.0 and gateway 192.168.2.1
AND i set my board ip addr as 192.168.2.32 netmask 255.255.255.0 …

when i connect my pc with another pc with a cable, ping operation is ok, however i just cannot ping my board …

It seems i cannot upload files now , so pity…

thx

I do not remember exactly, never tried P2P connection, but there’s some rule to follow in this topology. Like setting gateway to 0.0.0.0 because it is not existent in this configuration. It may happen that W5500 tries to reach gateway, and gets stuck as gateway does not respond.

You should be able to understand what is going on by looking into Wireshark if you install it on your PC. Most probably you will see that W5500 constantly sends ARP requests to gateway IP address.

yes ,you are right …
my pc is always trying arp request to 192.168.2.1.

i will have a try tommorrow and give you a reply …

thx

1 Like

I was talking about W5500 settings, not PC ones. PC’s network driver should be clever enough to understand that there’s no gateway out there, and continue working without gateway. But I am not sure about W5500 - it may get unavailable with incorrect gateway settings.

HI Eugency,
when i try to set gateway to 0.0.0.0, it infos me novalid …

it seems not work…

hello Eugency,
step 1 , hardware reset ;

step 2, set gateway, subnet mask,mac-address and ip;

step 3 ,read common regs.

AND do nothing ,but still cannot ping

does it mean it must be hardware problem??

Can you please dump the values of all registers in common register set so that we can check the configuration?

[ 7.237739] <5>.(5)[1:swapper/0]0x0 regvalue=0x0
[ 7.238443] <5>.(5)[1:swapper/0]0x100 regvalue=0xc0
[ 7.239184] <5>.(5)[1:swapper/0]0x200 regvalue=0xa8
[ 7.239920] <5>.(5)[1:swapper/0]0x300 regvalue=0x2
[ 7.240646] <5>.(5)[1:swapper/0]0x400 regvalue=0x1
[ 7.241371] <5>.(5)[1:swapper/0]0x500 regvalue=0xff
[ 7.242107] <5>.(5)[1:swapper/0]0x600 regvalue=0xff
[ 7.242843] <5>.(5)[1:swapper/0]0x700 regvalue=0xff
[ 7.243579] <5>.(5)[1:swapper/0]0x800 regvalue=0x0
[ 7.244309] <5>.(5)[1:swapper/0]0x900 regvalue=0x0
[ 7.245033] <5>.(5)[1:swapper/0]0xa00 regvalue=0x8
[ 7.245758] <5>.(5)[1:swapper/0]0xb00 regvalue=0xdc
[ 7.246498] <5>.(5)[1:swapper/0]0xc00 regvalue=0x91
[ 7.247269] <5>.(5)[1:swapper/0]0xd00 regvalue=0x97
[ 7.248005] <5>.(5)[1:swapper/0]0xe00 regvalue=0x98
[ 7.248741] <5>.(5)[1:swapper/0]0xf00 regvalue=0xc0
[ 7.249476] <5>.(5)[1:swapper/0]0x1000 regvalue=0xa8
[ 7.250222] <5>.(5)[1:swapper/0]0x1100 regvalue=0x2
[ 7.250957] <5>.(5)[1:swapper/0]0x1200 regvalue=0x20
[ 7.251704] <5>.(5)[1:swapper/0]0x1300 regvalue=0x0
[ 7.252438] <5>.(5)[1:swapper/0]0x1400 regvalue=0x0
[ 7.253174] <5>.(5)[1:swapper/0]0x1500 regvalue=0x0
[ 7.253915] <5>.(5)[1:swapper/0]0x1600 regvalue=0x0
[ 7.254651] <5>.(5)[1:swapper/0]0x1700 regvalue=0x0
[ 7.255388] <5>.(5)[1:swapper/0]0x1800 regvalue=0x0
[ 7.256123] <5>.(5)[1:swapper/0]0x1900 regvalue=0x7
[ 7.256858] <5>.(5)[1:swapper/0]0x1a00 regvalue=0xd0
[ 7.257648] <5>.(5)[1:swapper/0]0x1b00 regvalue=0x8
[ 7.258384] <5>.(5)[1:swapper/0]0x1c00 regvalue=0x28
[ 7.259131] <5>.(5)[1:swapper/0]0x1d00 regvalue=0x0
[ 7.259871] <5>.(5)[1:swapper/0]0x1e00 regvalue=0x0
[ 7.260606] <5>.(5)[1:swapper/0]0x1f00 regvalue=0x0
[ 7.261352] <5>.(5)[1:swapper/0]0x2000 regvalue=0x0
[ 7.262089] <5>.(5)[1:swapper/0]0x2100 regvalue=0x0
[ 7.262824] <5>.(5)[1:swapper/0]0x2200 regvalue=0x0
[ 7.263561] <5>.(5)[1:swapper/0]0x2300 regvalue=0x0
[ 7.264296] <5>.(5)[1:swapper/0]0x2400 regvalue=0x0
[ 7.265037] <5>.(5)[1:swapper/0]0x2500 regvalue=0x0
[ 7.265773] <5>.(5)[1:swapper/0]0x2600 regvalue=0xff
[ 7.266520] <5>.(5)[1:swapper/0]0x2700 regvalue=0xff
[ 7.267321] <5>.(5)[1:swapper/0]0x2800 regvalue=0x0
[ 7.268057] <5>.(5)[1:swapper/0]0x2900 regvalue=0x0
[ 7.268793] <5>.(5)[1:swapper/0]0x2a00 regvalue=0x0
[ 7.269527] <5>.(5)[1:swapper/0]0x2b00 regvalue=0x0
[ 7.270263] <5>.(5)[1:swapper/0]0x2c00 regvalue=0x0
[ 7.271001] <5>.(5)[1:swapper/0]0x2d00 regvalue=0x0
[ 7.271737] <5>.(5)[1:swapper/0]0x2e00 regvalue=0xbc
[ 7.272484] <5>.(5)[1:swapper/0]0x2f00 regvalue=0x0
[ 7.273219] <5>.(5)[1:swapper/0]0x3000 regvalue=0x0
[ 7.273954] <5>.(5)[1:swapper/0]0x3100 regvalue=0x0
[ 7.274690] <5>.(5)[1:swapper/0]0x3200 regvalue=0x0
[ 7.275430] <5>.(5)[1:swapper/0]0x3300 regvalue=0x0
[ 7.276172] <5>.(5)[1:swapper/0]0x3400 regvalue=0x0
[ 7.276907] <5>.(5)[1:swapper/0]0x3500 regvalue=0x0
[ 7.277697] <5>.(5)[1:swapper/0]0x3600 regvalue=0x0
[ 7.278434] <5>.(5)[1:swapper/0]0x3700 regvalue=0x78
[ 7.279180] <5>.(5)[1:swapper/0]0x3800 regvalue=0x25
[ 7.279928] <5>.(5)[1:swapper/0]0x3900 regvalue=0x4

Looks fine, the only issue I see that W5500 is thinking its PHY was not connected at the time you took the dump (LNK bit = 0). I would do the following: have board connected to your PC with Wireshark running on it, and see if W5500 sends any packets (it will sometimes) to ensure that it is just alive from the PC’s view. Probably the log you will see in Wireshark will help understand what is going on.

Hello Eugeny,
step1, hardware reset,
step2 ,set gateway, subnet mask,mac-address and ip,

AND now, ping my board with pc is ok…

so we think the board design is ok…

AND next, I restore my linux driver , and do as followings:

step1, adb shell ifconfig eth0 192.168.2.32;

step2, ping 192.168.2.32 with my pc…

and the ping operation failed

I want to know ,
if i set spi speed 100kHz, do you think it will fail ping operation??

Setting own IP address is not enough, you also must set network mask, e.g.
ifconfig eth0 inet 192.168.2.32 netmask 255.255.255.0

As I remember there’s no minimal value for the SPI speed for W5x00, thus you can use 100 kHz, or even 100 Hz, and it should still work.