2025-04-14 9:51 AM - last edited on 2025-04-14 10:05 AM by mƎALLEm
Hello ST Community,
I'm currently working with a NUCLEO-H755ZI-Q board and trying to set up a stable Ethernet communication using LWIP without RTOS. Unfortunately, I'm encountering an issue with a long initialization time and subsequent instability that I can't quite figure out.
My Hardware & Software:
Board: NUCLEO-H755ZI-Q
Cube Firmware : V1.18.0 (also tested with V1.17.0)
Configuration Steps in CubeMX/IDE (only for the M7, no changes for M4 made):
Created a new project for the NUCLEO-H755ZI-Q.
RCC: Set HSE (High Speed External Clock) to "Crystal/Ceramic Resonator".
Clock Configuration:
Configured System Clock (SYSCLK) to 400 MHz.
Adjusted all dependent clocks accordingly, ensuring CubeMX/IDE reported no clock configuration issues.
ETH:
Enabled Mode set to "RMII".
LWIP:
Enabled LWIP.
Disabled DHCP
A static IP address was configured: 192.168.001.123 with subnet mask 255.255.255.0
Selected "LAN8742" under "Platform Settings".
Generated code.
In the main() function, added the MX_LWIP_Process(); call inside the while(1) loop.
Observed Problem:
Long Startup Delay after Power-Up: When I power the board via the USB connector, it takes approximately 1 to 3 minutes before the board successfully responds to the first ping from a PC on the same network.
Stability after Initialization: Once this initial delay is overcome, the ping sometimes works stably and reliably.
Behavior on Reset/ETH Reconnect: Interestingly, the long delay does not occur if I reset the board using the reset button or if I briefly unplug and replug the Ethernet cable (assuming the connection was stable before). In these cases, the ping response is almost immediate.
Problem Returns after Power Cycle: However, as soon as I disconnect and reconnect the USB power supply (power cycle), the long 1-3 minute wait starts all over again.
Sporadic Instability: Additionally, sometimes even after the initial stabilization, the ping connection suddenly becomes unstable (Request timed out) after several minutes of operation, until the board eventually starts responding again on its own or is reset.
My Thoughts/Questions
PHY Initialization Delay: What could cause the PHY (LAN8742A) to take 1-3 minutes to establish a stable link only after a cold power-up? It works almost instantly after a software reset or Ethernet cable replug. Is there a specific initialization step, register setting, or timing dependency related to the PHY that might be sensitive to the initial power-on sequence?
Cache/MPU Configuration Issues: I have already tried enabling I-Cache and D-Cache and configuring the MPU according to common recommendations/guides often linked for STM32H7 + LWIP + Ethernet setups (often involving specific memory region settings for buffers). However, implementing these changes resulted in the Ethernet communication failing entirely (no ping response at all). Are there known pitfalls or specific H755ZI-Q considerations regarding cache coherency or MPU settings when using Ethernet/LWIP that might explain this failure or the initial delay problem?
Clock/LWIP Configuration: Could the clock settings (despite showing no errors in CubeMX) or the LWIP configuration itself?
Has anyone experienced similar power-on delay behavior with this setup? What would be effective strategies to debug this further?
I appreciate any help or pointers!
Thank you in advance!
Best regards,
Leo
2025-04-14 10:04 AM
Hello @Leo7 and welcome to the community,
For efficiency purpose, please refer to this article: How to create a project for STM32H7 with Ethernet and LwIP stack working
Hope that helps.
2025-04-14 11:02 AM - edited 2025-04-14 11:09 AM
@Leo7 What is on the other side of the ethernet cable? Is it a "serious" switch with 802.1x support, for example? or a small "desktop" switch/hub? Do the LEDs on the switch port give any clue?
2025-04-14 11:18 AM
@Pavel A.For the most part, I use a modern USB-C hub with Ethernet, but I’ve also tried it a few times with a cheap five-port network switch, the results were the same.
And the LEDs on the switch blink in sync with the pings.