W5500 as a server deals with communication problems


  1. I’m using the W5500 as a server. I’m making the connection by the Heperterminal.
    If I close the Heperterminal and try to connect again the server doesn’t realize that the connection was lost
    and doesn’t allow a new connection.
    what should I do in order to detect this failure and to send the server to initialize the socket again?

  2. if I’m working with the debugger for some reason I get in the S0_SSR register the value 0x16 instead of 0x17 ?

You should not just close the hyperterminal. Connection should be terminated properly. If there was connection established between your client and W5500 as server, your client should send disconnect request to W5500 before shutting down the channel.
Solution for your 0x16 problem: always use new source port number. First connection - port number c001, you use server and then properly close the connection, and second time you connect with port number c002. The issue is simple - when you use same source port connecting second time W5500, router or bridge may think that new connection is continuation of previous communication, but as soon as previous communication was already closed, “re-using” same port confuses all devices on the network.