W5100 Status Register Sn_SR unspecific value has been responsed

Hello Kazuhito-san, it is more important what happens after you see this code.
My guess is that it is one of the codes in the list while socket is being closed.

[quote]0x18 SOCK_FIN_WAIT
0x1A SOCK_CLOSING
0X1B SOCK_TIME_WAIT
0X1D SOCK_LAST_ACK

It is shown in the process of connection termination. If the
termination is normally processed or Timeout interrupt is
asserted, it will be automatically changed to SOCK_CLOSED.[/quote]

Wait for some time, and you should see SOCK_CLOSED (0x00) in this register. However if 0x1E happens to be for “quite some time”, then something is going wrong. In general your question is very related to what I asked in [url]Connection termination process problem!]. I decided NOT to use interrupts, but status codes instead.

  • If status code is <0x17 or >0x1D I immediately perform CLOSE command;
  • If codes are within range 0x17…0x1D then I perform DISCON, wait until command completes, and then perform CLOSE without waiting for any packets back. When I do CLOSE command I expect that status register will become 0x00 and do not bother about its value any more.

So far it works this way.