WIZnet Developer Forum

W5500 SN_CR never returns to 0 (infinite loop)

Hi All,

I make series of devices using W5500 chip.
Some of chips (~5%) I have hangs up during startup and code stucks in infinite loop. Other works fine. I dont expect this is hardware/PCB/soldering problem as communication with chip is working fine.

When opening UDP socket first action is to set “CLOSE” on socket. After setting SN_CR register to 0x10 it never returns to 0 but stays as 0x10. After ~4 seconds MCU is rebooted by watchdog. Please see screenshot attached:

Step “Check SN_CR” is not necessary, but I added it for debug purposes.

Code works as expected, it stays in while loop until SN_CR is cleared (as stated in W5500 docs). Question is WHY SN_CR is not cleared?

My software bases on Arduino, and uses Ethernet2 library from Arduino. Until now i didn’t have any problems with that and for ~20 produced units it was working fine.

Thanks for help!

Why MOSI goes high between command/data bytes? You must eliminate this behavior as unneeded wire level toggling may cause noise and false positives.

This is default in AVR (using Atmega328p), that MOSI in idle state is high. Plenty of SPI devices i used didn’t have any problems with that.

Although I agree that this may cause some misleading bits in extreme situations, we see that register is written correctly (stays with value 16)… And I don’t think may be source of trouble here. Anyway, I will try to modify software in meantime to force low state. Any other ideas maybe?

Not yet. Waveform picture looks more or less ok for me.

Hello mazimir,
Did you find a solution? I am having the same problem as you.


I’m not sure if this applies to the original poster’s situation, but I have observed the above behavior if I issue a close command while the PHY is powered down (using the OPMD and OPMDC bits in the PHYCFGR register).

For my use case, it’s fairly easy to simply not interact with the socket registers while the PHY is in down mode.

Hi All,

Sorry for leaving topic without solution…

Chips were soldered using hot air, by hand. After replacement new chip always worked fine. I expect that they were overheated and had some internal damages.


Copyright © 2017 WIZnet Co., Ltd. All Rights Reserved.