W5500 No PHY Link

Bit 0 of Register PHYCFGR of the W5500 does not indicate "link up" with ethernet cable connected when using the default "Link Status" example from the default ethernet library. I have verified SPI communication between the STM32F411CEU6 black pill board and the W5500 board with an oscilloscope and everything is as expected. Whatever I try the only thing that is returned is "Link status: OFF".

Troubleshooting steps I have tried so far:

  1. Verifying SPI communication is working
  2. Connecting to various devices:
  • Ethernet-> usb-c adapter dongle plugged into laptop
  • PC motherboard ethernet port
  • AX5400 Wifi router (verified to have auto-MDIX)
  1. Resetting W5500 during setup using RSTn pin, see code below


Screenshot of Oscope showing last bit of the last packet is 0 indicating "link down".

Hardware:
"Blackpill" STM32F411CEU6
W5500 Lite Breakout board

Wiring:

STM32F4 Pin Breakout Pin Name Oscope Channel
PA7 MO CH1
PA6 MI CH2
PA5 SCK CH3
PA4 CS CH4
PA3 RST none

W5500 datasheet

/*
  Link Status

  This sketch prints the Ethernet link status. When the
  Ethernet cable is connected the link status should go to "ON".
  NOTE: Only WIZnet W5200 and W5500 are capable of reporting
  the link status. W5100 will report "Unknown".
  Hardware:
   - Ethernet shield or equivalent board/shield with WIZnet W5200/W5500
  Written by Cristian Maglie
  This example is public domain.
*/

#include <SPI.h>
#include <Ethernet.h>

void setup() {
  digitalWrite(PA3, LOW);  // Reset W5500 
  delayMicroseconds(600);  
  digitalWrite(PA3, HIGH); 
  delay(1); 

  // You can use Ethernet.init(pin) to configure the CS pin
  //Ethernet.init(10);  // Most Arduino shields
  //Ethernet.init(5);   // MKR ETH Shield
  //Ethernet.init(0);   // Teensy 2.0
  //Ethernet.init(20);  // Teensy++ 2.0
  //Ethernet.init(15);  // ESP8266 with Adafruit FeatherWing Ethernet
  //Ethernet.init(33);  // ESP32 with Adafruit FeatherWing Ethernet

  Serial.begin(9600);
}

void loop() {
  auto link = Ethernet.linkStatus();
  Serial.print("Link status: ");
  switch (link) {
    case Unknown:
      Serial.println("Unknown");
      break;
    case LinkON:
      Serial.println("ON");
      break;
    case LinkOFF:
      Serial.println("OFF");
      break;
  }
  delay(1000);
}

Have you tried plugging it into a Hub or Switch? Going directly to your laptop you will need a crossover cable.

1 Like

Thanks for the response! One of the devices I tried was my AX5400 Wifi router which I verified to have auto-MDIX. I was thinking that this ruled out the possibility that the cable was incorrect.

I am not familiar with that unit but it sounds like you are correct but it never hurts to try another cable.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.