W5500 responding to SPI, but hangs on socket creation

Hi,

I have a custom board using a W5500 IC and the ioLibrary. SPI communication itself appears to work, as I can change values on the W5500 via wizchip_setnetinfo and reading it back via wizchip_getnetinfo. However attempting to open any socket causes the program to hang indefinitely in the close() function at [1]. Running the same code on one of the cheap Aliexpress Boards (larger, blue PCB one) works however. Also plugging in a network cable does not blink the LINK Led on my custom board, while it does on the Aliexpress one. Does anyone have an idea what I’m doing incorrectly?

Schematic:


PCB: https://i.imgur.com/zmh2XPh.png (can only attach one photo directly…)

[1] ioLibrary_Driver/socket.c at master · Wiznet/ioLibrary_Driver · GitHub

I will tell hardware engineer about your question.
He will response about it.
@Scott

You seems have made a number of mistakes in your board.

  • C6 is connectred wrongly;
  • R11/R13 must be 49.9 Ohms 1%, you have more than 2% deviation;
  • Why did you use 82 Ohm resistors for R14 and R15? These are for external fransformer type reference circuit. For built-in transformer magkjack they are 49.9 Ohms;
  • Why 10p capacitors for crystal oscillator? Did you perform calculations for the right values basing on crystal capacities?
  • Are required key resistors having 1% tolerance?
  • Is there any connection between 3V3 and 3V3A?
  • Is reset pin (W5500_Reset) driven or left connected to 3V3 through pull-up only as on the circuit?

Thanks for the reply.

You seems have made a number of mistakes in your board.

Very likely. It’s my first slightly more complex design compared to those that I could easily plug together on a breadboard. So any help is greatly appreciated. :slight_smile:

  • C6 is connectred wrongly;

Where exactly is the mistake? It’s connected to the transmission center tap of the RJ45 Magjack and ground, the same as in the reference schematic (C8 in that one).

  • R11/R13 must be 49.9 Ohms 1%, you have more than 2% deviation;

Right. Not sure where I got 51R from.

  • Why did you use 82 Ohm resistors for R14 and R15? These are for external fransformer type reference circuit. For built-in transformer magkjack they are 49.9 Ohms;

Good catch. Looks like I used the external schematic there for some reason.

  • Why 10p capacitors for crystal oscillator? Did you perform calculations for the right values basing on crystal capacities?

I’ve been using an Epson FA-20H 25.0000MF20X-K3 crystal with a 10pF load capacitance. I followed the formula found in the ST Oscillator design guide (AN2867) (CL = (C1*C2) / (C1+C2) + CStray), which yields me a C1/C2 value of 10pF for an assumed 5pF stray PCB capacitance. This is one thing that I’m especially unsure about, as I have very little experience with external oscillators.

  • Are required key resistors having 1% tolerance?

All resistors I used are 1%.

  • Is there any connection between 3V3 and 3V3A?

Yes, via an inductor (L1 on the PCB). I double checked an measured that 3V3A is present on the W5500.

  • Is reset pin (W5500_Reset) driven or left connected to 3V3 through pull-up only as on the circuit?

It’s hooked up to the main MCU (STM32F401RET), which pulls it down for 500ms pre-initialization and then pulls it back up to force a clean reset. I’m waiting for another 500ms before continuing with the initialization (via wizchip_init) to ensure the chip is ready (the W5500 datasheet specifies 150ms for that, but I’d rather be safe).

I’ve swapped out the Resistors with some 49.9R 1% now and this gets me a bit further. Now I end up getting stuck a few lines further in the socket function [1].

[1] https://github.com/Wiznet/ioLibrary_Driver/blob/master/Ethernet/socket.c#L236

Sorry my mistake. You did it correctly.

Very good.

Try performing software reset after this hardware reset. Set bit 7 of MR, and wait until it clears to 0, and then proceed to the chip configuration.

Dear ntldr

I’ve reviewed your PCB photos.

Did you connect the GND to trace?

GND is weak, it is difficult to operate the analog side.

You should be connected to GND is plane.

Thank you.

Scott

Hi ntldr
May I ask if your problem has been resolved? I have encountered some similar problems and would like to refer to your solution
Thank you