diff --git a/arch/arm/src/stm32h7/Kconfig b/arch/arm/src/stm32h7/Kconfig index 7ac7bf552b4..00e5b699927 100644 --- a/arch/arm/src/stm32h7/Kconfig +++ b/arch/arm/src/stm32h7/Kconfig @@ -501,14 +501,12 @@ config STM32H7_OTGFS bool "OTG FS" default n select USBHOST_HAVE_ASYNCH if USBHOST - select STM32H7_HSI48 config STM32H7_OTGHS bool "OTG HS" default n depends on EXPERIMENTAL select USBHOST_HAVE_ASYNCH if USBHOST - select STM32H7_HSI48 config STM32H7_OTG_SOFOUTPUT bool "OTG SOF output" diff --git a/arch/arm/src/stm32h7/stm32_otgdev.c b/arch/arm/src/stm32h7/stm32_otgdev.c index c1588eade24..c5e38b7a337 100644 --- a/arch/arm/src/stm32h7/stm32_otgdev.c +++ b/arch/arm/src/stm32h7/stm32_otgdev.c @@ -52,8 +52,10 @@ #if defined(CONFIG_USBDEV) && (defined(CONFIG_STM32H7_OTGFS) || \ defined(CONFIG_STM32H7_OTGHS)) -#ifdef CONFIG_STM32H7_OTGHS -# warning OTG HS not tested for STM32H7 ! +#if (STM32_RCC_D2CCIP2R_USBSRC == RCC_D2CCIP2R_USBSEL_HSI48) && \ + !defined(CONFIG_STM32H7_HSI48) +# error board.h selected HSI48 as USB clock source, but HSI48 is not \ + enabled. Enable STM32H7_HSI48 #endif /****************************************************************************