STM32H7S3 CubeMX bug - ETH_CLK pin not initialized when using external clock source for Ethernet PHY
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
