Skip to main content
Visitor II
February 11, 2025
Question

Example Ethernet loopback code for STM32H573 and LAN8742A.

  • February 11, 2025
  • 2 replies
  • 854 views

Hi,

I'm currently working on a project involving the STM32H573 microcontroller and the LAN8742A Ethernet PHY. My goal is to implement a simple Ethernet loopback test to verify the basic functionality of the Ethernet interface. Could you please provide if you have anything?

 

Thanks,

Ravi.ch

    This topic has been closed for replies.

    2 replies

    ST Employee
    February 11, 2025

    Hello @rchilakalapudi ,

    My understanding is that you want to implement an example without any middleware to test Ethernet controller functionality my recommendation is to have a look at the following article:

    How to create a bare metal HAL Ethernet applicatio... - STMicroelectronics Community

    Also, you can check a basic implementation using Azure Netxduo :

    STM32CubeH5/Projects/STM32H573I-DK/Applications/NetXDuo/Nx_TCP_Echo_Server at main · STMicroelectronics/STM32CubeH5

    or an example using LWIP middleware :

    stm32h5-classic-coremw-apps/Projects/NUCLEO-H563ZI/Applications/LwIP/LwIP_UDP_Echo_Server at main · STMicroelectronics/stm32h5-classic-coremw-apps
    Regards

    Super User
    February 13, 2025

    The LAN8742A can do internal loopback (without any external connection or cable). See the data sheet, 3.8.10 Loopback operation.  This section also explains how to make a connector for external loopback.