2025-12-08 2:32 AM - last edited on 2025-12-08 3:00 AM by STackPointer64
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):
Hardware & Cabling: Verified RMII pin connections, tried multiple cables/switches.
Network Config: Static IP set correctly, firewall disabled, host PC on same subnet.
Software: No compilation errors, added etharp_gratuitous(), MAC set to 00:80:E1:AA:BB:CC.
Debug Output: Prints show interface UP, link CONNECTED, correct IP/MAC, but no ping response and no ARP entry on host.
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:
Common pitfalls in LwIP + STM32F2 Ethernet setup.
How to verify if packets are actually received by the MAC.
Steps to debug PHY register states and link status.
Any known workarounds for ping/ARP issues in static IP mode.
I’ve attached relevant code snippets. Any guidance would be greatly appreciated!
2025-12-08 3:06 AM
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,
2025-12-08 3:09 AM
Some LwIP debug/diagnostic tips/resources: