Skip to main content
Associate
June 29, 2026
Question

STM32H7, Ethernet - Setting MDC pin seems to wipe out TX_CLK

  • June 29, 2026
  • 2 replies
  • 25 views

Hello,


First time posting here so I apologise in advance to admins if this is in the wrong area.

I’m attempting to use a DP838xx series PHY with an STM32H7xxx series chip in MII mode and I’m running into this odd issue where whenever the ETH_MDC pin is initialized, the TX_CLOCK completely drops out. I believe my PHY is reset when I set the MDC pin. I can’t seem to get around this at the moment and wonder if perhaps there is something quirky or unusual that I’m not aware of?

I have this crazy idea that perhaps the pin is being pulled low just at the right time as to send something to the PHY to tell it to reboot or shutdown but I’m not able to look into that much detail.

Things I have tried:
1. Full setting up my PHY by writing to it’s registers for MII mode and the correct physical medium
2. The same but in RGMII mode and then attempting to switch
3. Completely fresh project without LWiP stack, manually enabling the ethernet pins one at a time (this is where I discovered that the MDC pin was the issue)
4. Setting up the mac-side first and then the PHY

I would appreciate any help, apologies if I have not been quite clear.

Alternatively, I would be very grateful if anyone had any links to code examples for those chips/phys. 

I have looked at How to make Ethernet and lwIP working on STM32 | Community but to no avail.


Thanks,
cool-dude-1337

2 replies

ST Technical Moderator
June 29, 2026

Hi ​@cool-dude-1337 and welcome to ST Community,

I think MDC is not a data/control pin that should reset the PHY by itself. I suspect one of these : 

  • the pin assignment overlaps,
  • the PHY is being reset,
  • or the PHY clock output is disabled because the PHY is not in the expected mode. So check the hardware clock from PHY.

 

Verify that the board really routes the PHY generated TX clock back to the MAC.

To give better visibility on the answered topics, please click on "Best answer" on the reply which solved your issue or answered your question.Best regards,FBL
Associate
June 30, 2026

Hi FBL,

Thanks for the reply.

I have checked that the TX clock definitely goes into the mac in hardware and that the HW clock on the PHY is correct.

Seemingly got a little further by changing the MDC pin’s function to one that isn’t AF11_ETH which keeps the clock intact, still can’t seem to get a physical link up.

Thanks,
cool-dude-1337

ST Technical Moderator
July 1, 2026

Hi ​@cool-dude-1337 

Can you provide further details : which STM32H7 are you using, package.. Do you reproduce on a reference board? (nucleo, disco..) If not, can you share your schematics? Also check PHY’s troubleshooting guide: Maybe, the PHY can mistakenly re-strap itself into a different mode

To give better visibility on the answered topics, please click on "Best answer" on the reply which solved your issue or answered your question.Best regards,FBL