Page 1 of 1

W5500 Socket Status

Posted: Tue Mar 19, 2024 1:20 pm
by Qualcomm5
I'm successfully connecting/testing W5500 networked comms with PuTTY terminal (RAW) via single socket '0'. However, the actual meaning of 'Socket Status' from the component is somewhat elusive, with no supporting information.

I'm returning socket status value via debug UART in 0.5s loop cycles, with the following decimal values returned for each status...

Default from boot (socket created): 20 (0b10100)

On terminal connect (1st message): 23 (0b10111), sustained whilst connected.

On terminal disconnect (PuTTY closed): 28 (0b11100)

After a minute or-so: 0 (0b00000), reconnect refused.

As I could do with understanding this information for appropriate socket management (i.e. close/open socket reset after remote terminal closure), is anyone aware of associated status bit values and how to reliably interpret them please?

Thanks and best regards,
Brendan

Re: W5500 Socket Status

Posted: Tue Mar 19, 2024 4:46 pm
by BenR
Hi Brendan,

The status is basically reading the Status Register of the W5500 IC.

Sn_SR (Socket n Status Register) [R] [0x0003]

The datasheet here, specifically pages 49 and 50 tell you what the values mean.

https://cdn.sparkfun.com/datasheets/Dev ... .0.2_1.pdf

Maybe we can put some more diagnostics in place in the component to help determine the meanings.

Re: W5500 Socket Status

Posted: Tue Mar 19, 2024 10:12 pm
by Qualcomm5
Thank you Ben, that's great.

No issues at-all with this, now I can be confident with the information presented. Working like a charm now, merely checking if link status > 23d and immediately resetting the affected port well before timeout in the main program loop :)

I believe this info to be important in both confirming link establishment and resetting broken links for re-establishment, so either verbose summary or deconstruct of returned info from socket status would doubtless be useful - thank you.

All the best,
Brendan