diff --git a/arch/arm/src/stm32h5/stm32_ethernet.c b/arch/arm/src/stm32h5/stm32_ethernet.c index ff193f57b17..41a88fb221a 100644 --- a/arch/arm/src/stm32h5/stm32_ethernet.c +++ b/arch/arm/src/stm32h5/stm32_ethernet.c @@ -3604,9 +3604,10 @@ static inline void stm32_ethgpioconfig(struct stm32_ethmac_s *priv) #if defined(CONFIG_STM32H5_MII) || defined(CONFIG_STM32H5_RMII) /* MDC and MDIO are common to both modes */ - +# ifndef CONFIG_STM32H5_NO_PHY stm32_configgpio(GPIO_ETH_MDC); stm32_configgpio(GPIO_ETH_MDIO); +# endif /* Set up the MII interface */ diff --git a/arch/arm/src/stm32h7/stm32_ethernet.c b/arch/arm/src/stm32h7/stm32_ethernet.c index 5b74a103285..476a5fb3eaa 100644 --- a/arch/arm/src/stm32h7/stm32_ethernet.c +++ b/arch/arm/src/stm32h7/stm32_ethernet.c @@ -3699,9 +3699,10 @@ static inline void stm32_ethgpioconfig(struct stm32_ethmac_s *priv) #if defined(CONFIG_STM32H7_MII) || defined(CONFIG_STM32H7_RMII) /* MDC and MDIO are common to both modes */ - +# ifndef CONFIG_STM32H7_NO_PHY stm32_configgpio(GPIO_ETH_MDC); stm32_configgpio(GPIO_ETH_MDIO); +# endif /* Set up the MII interface */