Ping from W5500

Anyone know of a library or command that I could use to get my W5500 to ping another IP on the network?

Hi,
You can modify W5500’s network register as SIPR, SUBR and GAR using SPI interface.
Refer to W5500’s driver code ([url]http://www.wizwiki.net/wiki/doku.php?id=products:w5500:driver[/url])

Thank you.

Hi, I’m not having any issues connecting my chip to the network. It’s on the network fine and I’ve got Static and DHCP both working. What I want to do is send data to a server on my network, but sometimes the server will be turned off, so I want my module to ping the server at regular intervals so I know when it’s online…

Hi,
I mis-understood what you asked. I’m sorrry.

You can ping to another with W5500.

Refer to [url]http://www.wizwiki.net/wiki/doku.php?id=products:w5500:application:ipraw[/url].

Thank you.

Ok great thanks! Also, is there anyway the chip can detect the network speed. It can obviously support 10 and 100 mbps speeds, but I would like it to be able to detect the speed automatically when connected and apply whatever speed is supported.

Just tried implementing the ping code from the coocox code. Also been looking at the documentation for it. It mentions setting up the socket protocol as ICMP, which makes sense, and it talks about a Sn_PROTO register, which from the CooCox code, should be at position 0x0014. But the datasheet marks that register as reserved. I’ve tried sending the packets, and wireshark marks them as Protocol 0: IPv6 hop-by-hop option. Everything else in the packet seems legit. Is there a firmware upgrade for the chip or something that enables the PROTO register for raw ip?

Hi,
As you said, Sn_PROTOR register is reseved but you can use it with IPRAW mode.
I think you maybe mistake to write the Sn_PROTOR. Becase Sn_PROTOR can’t be written, You see the 0 protoocl number(hop-by-hop ipv6) on wireshark.
Check to write and read of Sn_PROTOR, again.

Thank you.

Sorry not sure I understand. Are you saying the register is write protected?

Hi,
What I said is that Sn_PROTOR is not written to your wanted value because Sn_PROTOR reset value was 0x00 and not changed.
If you succeed to write Sn_PROTOR to 0x01(ICMP protocol number), you can ping to a server.

Verify Sn_PROTOR read/write & Sn_PROTOR’s address map.

Thank you.

Hi,

Thanks got it working now. On another note, the w5500 has the ability to communicate at 10Mbps or 100Mbps. Do you know of any simple way for the w5500 to automatically detect the network speed and set it to the right one?

Hi,
What you asked is about configruation internal PHY.

To configure internal phy of W5500, You can try it with 2 method.

  1. Hardware pin configruations
    ==> Refer to page 9~10 in W5500 datasheet
    ==> PMODE[2:0] : Pin# 43, 44, 55
    ==> Network indicator(SPDLED,LINKLED,DUPLED,ACTLED) : Pin# 24, 25,26,27

  2. Software configruation with PHYCFGR register
    ==> Refer to page 42 in W5500 datasheet

Note that PHYCFGR indicates the network status as speed, duplex, and link.

Thank you.

Hi yes, I’m aware that I can configure it manually, but what I want to do is write some code which automatically detects the network speed and then configures the phy. Is that possible?

Hi,
I’m already answered.

You can control internal PHY mode as autonego, speed, duplex, and etc using PHYCFGR register.
Refer to PHYCFGR regsiter.

Thank you.

Hi Wiznet

If IPRAW mode is supported on W5500 why its not documented in the datasheet ? I just checked W5500 datasheet v1.0.4 13 June 2014 and its still not there. :confused:

Is there any reason for not publishing it?

Hi,
IPRAW mode & MACRAW mode is not popular functions so it maybe omitted in datasheet.
W5500’s IPRAW mode Application is decribed at here. refer it.
[url]http://www.wizwiki.net/wiki/doku.php?id=products:w5500:application:ipraw[/url]

Thank you.

Hello.
I read the answer, but couldn’t understand how to set the protocol.
I see that the func/macro of Sn_PROTO() does not exist any more.
So, what is the solution for that issue in W5500?

Thanks,
Aviv

From W5500.h header file…

#define _W5500_IO_BASE_              0x00000000
#define WIZCHIP_SREG_BLOCK(N)       (1+4*N) //< Socket N register block
#define Sn_PROTO(N)         (_W5500_IO_BASE_ + (0x0014 << 8) + (WIZCHIP_SREG_BLOCK(N) << 3))

When is the complete W5500 manual coming…

All the examples of using ICMP revert to un documented registers, which are not listed…
The W5200 had a proto register at 0x0018 but that seams to be missing…
and the New library’s for the W5500 have all the socket macros removed…

Sorry!
WIZnet did not support IPRAW mode socket officially, but support that privately.

You can refer to http://www.wizwiki.net/wiki/doku.php?id=products:w5500:application:ipraw

You has to modify ioLibrary related with IPRAW mode.

Thank you.

Hello WIZnet Team!
i am using socket 2 of W5500
i tried to change the S2_PROTO register (0x0014) to ICMP protocol (0x01) and read it back, and success (the value changed to 0x01). and then i opened the socket using OPEN command (0x01) to S2_CR (0x0001) and read the status from S2_SR (0x0003), the result always 0x00 (SOCK_CLOSED), but you say it must be SOCK_IPRAW (0x32). i dont know what is wrong here. or should i set the S2_MR too? but there is no ICMP protocol option there. can you help me?