Debugging issues with W5500/LAN8720 communicating with STM32 and gigabit switch chips
Debugging issues

Troubleshooting Guide
Subject: W5500 / LAN8720 + STM32 + Gigabit Switch Communication Troubleshooting
1. W5500 Not Working: Check the Crystal Oscillator
Symptoms: W5500 does not operate
Possible Cause: External crystal not oscillating properly
Checklist and Actions:
- Use an oscilloscope to check the XTAL1/XTAL2 pins for a 25 MHz signal
- Valid signal characteristics:
- Around 1.5 V DC offset
- Approx. 0.5 V peak-to-peak AC amplitude
- Replace the crystal component if signal is not observed or soldering is poor
2. SPI Communication Issue Between STM32 and W5500
Symptoms: SPI communication unstable or completely failed
Possible Cause: Incorrect SPI pin setup or excessive SPI speed
Checklist and Actions:
- Set SPI mode to AF_PP (Alternate Function Push-Pull)
- Set GPIO output speed to High (50 MHz)
- If line length is long, test with a lower SPI clock (1–4 MHz recommended)
3. W5500 and Gigabit Switch Connection Problem
Symptoms: No link established between W5500 and the switch
Possible Cause: Electrical level mismatch or lack of Auto-MDIX support
Checklist and Actions:
- Confirm the switch chip supports Auto-MDIX
- Ensure correct signal routing:
- W5500 TXP/TXN ↔ Switch RX
- W5500 RXP/RXN ↔ Switch TX
- Use a network transformer to match signal characteristics
4. UDP Reception Fails on PC
Symptoms: MCU sends UDP packets, but PC does not receive them
Possible Cause: Windows firewall or antivirus software blocking packets
Checklist and Actions:
- Temporarily disable firewall to test
- Alternatively, add a firewall exception for the specific UDP port
- If network is classified as Public, switch it to Private for local access
5. Gigabit Switch Does Not Work
Symptoms: No activity, no link LED, no heat on the chip
Possible Cause: Component misplacement, especially pull-up/down resistors
Checklist and Actions:
- Double-check circuit diagram against the PCB
- Specifically verify resistors on the MDIREF pin (e.g., 2.49kΩ)
- Ensure proper voltage levels at the switch’s power and signal lines
6. LWIP UDP Socket Binding Issue
Symptoms: Only one remote IP/port can communicate via UDP
Possible Cause: UDP socket bound to a fixed remote address
Checklist and Actions:
- Use
IP_ADDR_ANY
when callingudp_bind()
to allow multiple sources - Avoid binding to a single remote IP/port unless required
7. Quick Summary of Checklist
No. | Issue | Action Summary |
---|---|---|
1 | W5500 crystal not oscillating | Check 25 MHz signal using oscilloscope |
2 | STM32–W5500 SPI unstable | Adjust pin mode, lower SPI clock |
3 | No link with gigabit switch | Ensure Auto-MDIX support, use transformer |
4 | UDP data not received on PC | Configure firewall or disable temporarily |
5 | Switch not powering on | Check component values and MDIREF resistor |
6 | UDP reception limited to one peer | Bind UDP socket to IP_ADDR_ANY |
8. Additional Best Practices
Power Stability: Ensure proper and stable power to all devices.
Firmware Updates: Make sure STM32, W5500, and LAN8720 firmware are up to date.
Visual Indicators: Use LEDs to monitor link and activity states.
Packet Monitoring: Use tools like Wireshark to analyze actual UDP traffic and packet behavior.