diff --git a/arch/arm/src/stm32/stm32f20xxx_rcc.c b/arch/arm/src/stm32/stm32f20xxx_rcc.c index a45241ed85b..ad71714a803 100644 --- a/arch/arm/src/stm32/stm32f20xxx_rcc.c +++ b/arch/arm/src/stm32/stm32f20xxx_rcc.c @@ -195,7 +195,13 @@ static inline void rcc_enableahb1(void) #ifdef CONFIG_STM32_OTGHS /* USB OTG HS */ +#ifndef BOARD_DISABLE_USBOTG_HSULPI + /* Enable clocking for OTG and external PHY */ + regval |= (RCC_AHB1ENR_OTGHSEN | RCC_AHB1ENR_OTGHSULPIEN); +#else + regval |= (RCC_AHB1ENR_OTGHSEN); +#endif #endif putreg32(regval, STM32_RCC_AHB1ENR); /* Enable peripherals */ diff --git a/configs/photon/include/board.h b/configs/photon/include/board.h index ac5faed041e..efce6731152 100644 --- a/configs/photon/include/board.h +++ b/configs/photon/include/board.h @@ -146,6 +146,10 @@ #define STM32_APB2_TIM10_CLKIN (2*STM32_PCLK2_FREQUENCY) #define STM32_APB2_TIM11_CLKIN (2*STM32_PCLK2_FREQUENCY) +/* USB OTG HS definitions ***********************************************************/ +/* Do not enable external PHY clock or OTG_HS module will not work */ +#define BOARD_DISABLE_USBOTG_HSULPI 1 + /* Alternate function pin selections ************************************************/ /* UART1 */