W5500 - How to perform a simple loop back test?

I need to run a simple loop back test that will be used as part of the manufacturing process. On the RJ45 connector, I can have pin #1 connected to #3, and pin #2 connected to #6. I want to send an IP packet, then verify the received IP packet. Any idea how I can do this with W5500?

You write application for W5500 which sends packet and then receives packet (obtains received packet from the RX buffer).

Eugeny, I know I could use socket APIs, for example, create a TCP server, create a TCP client, then send a TCP packet to the server. However, I am hoping something simpler, something like an ARP packet, but I don’t know what API to use.

First of all you need to identify what you actually want to test with all these measurements. Is it just connectivity? Or also wider operational functions of the chip?

There’re a number of ways how you can do it. If you prefer ARP, you can use MACRAW mode. But I would recommend not to be too sophisticated in the choice and do the simplest things every one does with these chips - one socket as a TCP server, another socket as TCP client, and just send some test packet.

I did not test W5x00 this way, and not sure if this communication will be processed through the PHY, and not internally by the chip. If I would be you I would perform - as a test to ensure things are function as expected - “loopback” through the simple hub and have another PC with Wireshark connected to it so that you can capture things W5500 sends in case you need it. Anyway you will have to plug something into the jack, would it be loopback cable, or connector with wire. However if you have a dozen of workplaces of course loopback is much more convenient :slight_smile:

1 Like

Connectivity is the only thing I am interested in. I see your point - Having a TCP server and client might be a simpler approach given all the APIs are already available. And, yes, a loopback RJ45 plug will be used.

I found this old post and was able to use the MACRAW mode socket to send (sendto) “Hello, World!” and receive (recvfrom) “Hello, World!” using a loopback RJ45 plug.

2 Likes