W5500 as a client connection problem

I successfully ran W5500 as a server (I can connect to it, of course), but I have a problem with a client mode.
Writing to the registers looks like this:

  • PHY configuration (OK - address, mask, gateway, MAC 00-08-DC-01-02-03 as in the datasheet)
  • MR->0x01 (TCP mode)
  • PORT->46 (source port)
  • CR->1 (socket open)
  • loop to check, if opened - OK
  • DIPR-> (target IP)
  • DPORT->46 (target port, the same as the PORT)
  • CR->4 (connect)
  • loop to check, if established (if SR->0x17) - this fails and it’s always endless loop
    And in this loop SR is 0x13 (opened) for about 2 seconds, and then it becomes 0 (disconnected). In IR register bits TIMEOUT and DISCON are always set (why is it like this?)

I tried with connecting through router and directly between computer and W5500. Windows Firewall is turned off.

You must look into the Wireshark logs to see if SYN packet is really being sent, what exactly it has inside, and what is the response of the server (or no response or “destination is unreachable”).

1 Like

Thank you for fast response, Eugeny.
Although in the meantime I was trying to do it and it finally worked. I set the retry timeout and retry count registers higher and it looked like server is rejecting connections immediately (but when the firewall was enabled, it was trying to connect until the timeout), so I tried with another server software and it finally worked. Thank you.

1 Like