2026-03-22 3:41 AM
Hello,
I found a bug in STM32CubeMX code generation for STM32H7S3.
When configuring Ethernet with external clock input (ETH_CLK pin,
PD6 with AF4_ETH) as PHY clock source, CubeMX does not generate
GPIO initialization for this pin in HAL_ETH_MspInit().
Workaround - must add manually:
__HAL_RCC_GPIOD_CLK_ENABLE();
GPIO_InitStruct.Pin = GPIO_PIN_6;
GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
GPIO_InitStruct.Pull = GPIO_NOPULL;
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH;
GPIO_InitStruct.Alternate = GPIO_AF4_ETH;
HAL_GPIO_Init(GPIOD, &GPIO_InitStruct);
Without this, Ethernet does not work even though all other
ETH pins are correctly initialized by CubeMX.
Steps to reproduce:
1. Select STM32H7S3
2. Enable Ethernet (ETH)
3. Set clock source to external clock via ETH_CLK pin (PD6)
4. Generate code
5. ETH_CLK pin GPIO init is missing in generated code
CubeMX version: 6.17.0
MCU: STM32H7S3
Thank you
Solved! Go to Solution.
2026-03-22 11:25 AM - edited 2026-03-23 5:54 AM
Hello @Happybolt
Your contribution is much appreciated.
Issue has been escalated to dev team under internal ticket ID #0060894
I will keep you posted with updates.
THX
Ghofrane
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2026-03-22 5:48 AM
Unable to duplicate. Please include your IOC file.
2026-03-22 6:12 AM
2026-03-22 11:25 AM - edited 2026-03-23 5:54 AM
Hello @Happybolt
Your contribution is much appreciated.
Issue has been escalated to dev team under internal ticket ID #0060894
I will keep you posted with updates.
THX
Ghofrane
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.