W5500 hangs router

I amb developing a project using a w5500 to make UDP and TCP transmissions via Ethernet with a custom board.

In some occasions, after some time with the board working, the router crashes, causing all connected devices to lose internet connection. Working time before the crash may vary from few minutes to full hours, and there are usullay resets in the middle for debug purposes.

As soon as the ethernet is unplugged from the board, router’s behavior goes back to normal and the network internet is restored without the need of reset.

The problem was supposedly caused by not correctly closing the sockets. Recently I solved a part of code that kept some sockets from correctly disconnecting and closing, and the router problem has not repeated ever since. However, I want to make sure if this was the real cause. I will do some testing, but I would love to know the theory behind this misbehavior, what might cause the router to react this way, and get correction if my assumption is wrong.

Additional information:

  • The created sockets are one UDP to get a DNS ip address, and two TCP sockets.
  • W5500 source IP and port are configured static.
  • Devices connected to router use both ethernet and wifi. They all lost internet.

Thanks in advanced for the contributions in that topic.

If any more information is acquired, it will be posted.


Can you share your old code and new one with us?
With both codes, we may be able to investigate what the root cause was.

And do you have any file which you captured packets in when the router crash happened?
If not, I’d like to ask you to capture packets with the old code using wireshark.exe.

Thank you.

I am not allowed to share the code and neither have wireshark captures from the moment of the crash. I can make captures of the current behavior if you want.

Don’t you know any general reason that may cause the router to act like this? Maybe IP or port conflict, or too many open ports?

What are those two TCP sockets, server or client? I am not sure what “static port” means in your statement. Are you using the WIZnet ioLibrary?

TCP sockets both act as client, pointing simultaneously to two different servers.

As static port, I mean that one arbitrary source port value is assigned and is always the same for each socket (0xCA00+socketNumber).

No WIZnet ioLibrary. I am creating my own functions. If you ask for a certain bit of code, I might be able to share it.

Don’t you know any general reason that may cause the router to act like this?

In fact, we have never got any reports like this from customers.
So, we can’t guess what made this symptom.

The packets when the router gets crashed are helpful for us to investigate.

I am sure router logs will tell you the reason for its reboot/hanging, or will at least give you an idea what was happening before problem occurs.