cancel
Showing results for 
Search instead for 
Did you mean: 

Subject: Ethernet Init Issue (HAL_ETH_ERROR_TIMEOUT) on STM32H573RIT6 with LAN8742

VijayKushwah
Associate II

Subject: Ethernet Init Issue on STM32H573RIT6 with LAN8742

Hello ST Community,

I’m currently working on a project using the STM32H573RIT6 and I’m using STM32CubeMX and STM32CubeIDE as my development tools. My project setup is bare-metal (no RTOS) and I’ve successfully configured several peripherals already.

Now I’m trying to bring up Ethernet using the LAN8742 PHY, which is connected via RMII. However, I’m encountering an issue during initialization — specifically, HAL_ETH_Init() fails and returns the error:
HAL_ETH_ERROR_TIMEOUT.

Here’s my setup:

  • MCU: STM32H573RIT6

  • PHY: LAN8742 (on custom hardware)

  • Interface: RMII

  • Configured using STM32CubeMX (default settings mostly)

  • No RTOS — standalone implementation

  • Using STM32Cube HAL drivers

I’ve double-checked the hardware connections — 50 MHz clock is present, reset pin is pulled correctly, and MDIO/MDC lines are connected properly. The PHY address is set to 0 (default), and matches the CubeMX configuration.

Questions:

  1. What usually causes HAL_ETH_ERROR_TIMEOUT during HAL_ETH_Init()?

  2. Are there common configuration mistakes or hardware-related causes when using LAN8742 with STM32H5 series?

  3. Do I need to manually delay or reset the PHY before calling HAL_ETH_Init()?

  4. Any advice on how to debug the MDIO communication or verify that the PHY is responding correctly?

If anyone has experience with this setup or has example working configurations, I would really appreciate your help. I can share screenshots of my CubeMX setup or relevant parts of the code if needed.
Any advice, example projects, or tips would be greatly appreciated!

Thank you in advance!

Best regards,
Er.Vijay Kushwah
Email:vijaykushwah1112@gmail.com
Gailron Control Devices Pvt. Ltd.
r&d@gailron.com
DLF industrial area Faridabad,Haryana,India.

1 REPLY 1
Pavel A.
Super User

What usually causes HAL_ETH_ERROR_TIMEOUT during HAL_ETH_Init()?

IIRC reset of the ETH device waits for some handshake with the PHY so it can timeout because of PHY problem.

While waiting for more useful replies, re-check the PHY.