2025-05-21 12:16 AM - last edited on 2025-05-21 12:54 AM by Andrew Neil
Dear ST team,
I’m facing an issue with my STM32F407-based system connected to a LAN8742A Ethernet PHY. After performing either a software reset or hardware reset, the device fails to respond to ping requests. Sometimes it works after a reset, but most of the time, it doesn’t.
What Happens:
After reset, the LAN8742A doesn't respond to ping.
Ping resumes only after power cycling (disconnecting and reconnecting power).
This happens consistently after both software and hardware resets.
Setup:
MCU: STM32F407
PHY: LAN8742A (25MHz external crystal)
Stack: LWIP (HAL-based) - multiple thread using same stack(HTTP,UDP,TCP.etc.)
RTOS: FreeRTOS
I have attached the controller & Ethernet schematic file the reference taken from nucleo board STM32F429ZI
How can I make the Ethernet link stable after every reset without needing a full power cycle?
Any suggestions would be very helpful. Thank you!
2025-05-21 1:01 AM
What debugging have you done to find what's different between the working & non-working cases?
Have you enabled LwIP diagnostics to see what's going on there:
https://www.nongnu.org/lwip/2_0_x/group__lwip__opts__debug.html
https://www.nongnu.org/lwip/2_0_x/group__lwip__opts__debugmsg.html
Have you instrumented your own code (eg, with printfs, LEDs, etc) to see what's going on there?
2025-05-21 3:25 AM
Yes, I have enabled LwIP diagnostics by enabling the debug options in the LwIP configuration.
I’ve also redirected printf output to my debug UART, so all LwIP debug logs are printed to the serial console.
I checked the logs in both working and non-working conditions- no errors appear, and all initialization complete successfully. I also tried stepping through the code with a debugger but didn’t find any thing.
What I’ve Tried:
Verified NRST pin wiring and capacitor placement for the PHY.
Confirmed proper reset behavior of both MCU and PHY.
Ensured Ethernet is re-initialized properly after reset.
Tried manually resetting the Ethernet MAC using:
__HAL_RCC_ETHMAC_FORCE_RESET();
HAL_Delay(10);
__HAL_RCC_ETHMAC_RELEASE_RESET();
HAL_Delay(10);
Still, the issue persists.