Skip to main content
Visitor II
December 8, 2025
Question

Can't ping STM32F207ZGT6U with LwIP Despite Correct Configuration

  • December 8, 2025
  • 2 replies
  • 162 views

Issue Description:
I am unable to ping my STM32F2 board from another computer on the same network. The Ethernet link shows as UP and the MAC/IP addresses appear correctly, but ping requests timeout. I have been debugging this for a week without success.

What I’m trying to achieve:
Set up basic Ethernet communication using LwIP on STM32F2, assign a static IP (174.16.10.101), and make the board respond to ping.

Clock Configuration:

  • HSE: 25 MHz

  • PLLM: 25, PLLN: 200, PLLP: 2 → SYSCLK: 100 MHz

  • AHB: 100 MHz

  • APB1: 25 MHz

  • APB2: 50 MHz

  • ETH Clock Source: HSE (25 MHz) → RMII Ref Clock: 50 MHz

  • PHY: LAN8742A, Address: 0x01

What I’ve already tried (without success):

  1. Hardware & Cabling: Verified RMII pin connections, tried multiple cables/switches.

  2. Network Config: Static IP set correctly, firewall disabled, host PC on same subnet.

  3. Software: No compilation errors, added etharp_gratuitous(), MAC set to 00:80:E1:AA:BB:CC.

  4. Debug Output: Prints show interface UP, link CONNECTED, correct IP/MAC, but no ping response and no ARP entry on host.

  5. RTOS/LwIP: CMSIS-RTOS V2, LwIP in NO_SYS mode, Ethernet thread created, MX_LWIP_Init() called in default task.

Suspected Issues:

  • PHY initialization/link negotiation incomplete.

  • Ethernet DMA/Rx descriptors not passing packets to LwIP.

  • Interrupts/semaphores for packet reception not triggering.

  • Clock/timing issue in RMII interface.

Request for Help:
Could someone please review and suggest:

  1. Common pitfalls in LwIP + STM32F2 Ethernet setup.

  2. How to verify if packets are actually received by the MAC.

  3. Steps to debug PHY register states and link status.

  4. Any known workarounds for ping/ARP issues in static IP mode.

I’ve attached relevant code snippets. Any guidance would be greatly appreciated!

    This topic has been closed for replies.

    2 replies

    Technical Moderator
    December 8, 2025

    Hello @Bhuvi, and Welcome to ST Community!

    Please try changing the PHY address to 0x00 and use FreeRTOS CMSIS V1 instead of V2. Additionally, could you attach screenshots of your LwIP configuration? Have you ensured that the Ethernet interrupt is enabled?

    Best regards,