cancel
Showing results for 
Search instead for 
Did you mean: 

Can't ping STM32F207ZGT6U with LwIP Despite Correct Configuration

Bhuvi
Associate

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!

(Virus scan in progress ...)
(Virus scan in progress ...)
(Virus scan in progress ...)
2 REPLIES 2
STackPointer64
ST Employee

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,

To improve visibility of answered topics, please click 'Accept as Solution' on the reply that resolved your issue or answered your question.
Andrew Neil
Super User

Some LwIP debug/diagnostic tips/resources:

https://community.st.com/t5/stm32-mcus-products/lwip-ethernet-in-stm32h7-working-in-stm32cubeide-but-not-in-iar/m-p/748501/highlight/true#M267524

A complex system that works is invariably found to have evolved from a simple system that worked.
A complex system designed from scratch never works and cannot be patched up to make it work.