From ea53b35d754c872ce251febdda3fbbc77a537dfd Mon Sep 17 00:00:00 2001 From: Marian Buschsieweke Date: Fri, 14 Oct 2022 03:53:17 +0200 Subject: [PATCH] cpu/stm32: fix KConfig modeling for STM32F1 / usbdev_synopsys_dwc2 This fixes incorrect module selection for STM32F1 boards with feature periph_usbdev, a regression introduced by https://github.com/RIOT-OS/RIOT/pull/17812 --- cpu/stm32/Makefile.dep | 6 +++++- cpu/stm32/periph/Kconfig | 7 ++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/cpu/stm32/Makefile.dep b/cpu/stm32/Makefile.dep index 816392c439..438c609426 100644 --- a/cpu/stm32/Makefile.dep +++ b/cpu/stm32/Makefile.dep @@ -4,10 +4,14 @@ USEMODULE += periph stm32_clk stm32_vectors ifneq (,$(filter periph_usbdev,$(FEATURES_USED))) - # TODO: STM32F105xx and STM32F107xx also use synopsys_dwc2 + # All STM32 families except for STM32F1, STM32F3 and STM32WG use synopsys_dwc2 ifeq (,$(filter f1 f3 wb,$(CPU_FAM))) USEMODULE += usbdev_synopsys_dwc2 endif + # In STM32F1 family STM32F105xx and STM32F107xx also use synopsys_dwc2 + ifneq (,$(filter stm32f105% stm32f107%,$(CPU_MODEL))) + USEMODULE += usbdev_synopsys_dwc2 + endif USEMODULE += ztimer USEMODULE += ztimer_msec endif diff --git a/cpu/stm32/periph/Kconfig b/cpu/stm32/periph/Kconfig index c5be31ce95..83af95ccde 100644 --- a/cpu/stm32/periph/Kconfig +++ b/cpu/stm32/periph/Kconfig @@ -10,7 +10,12 @@ config MODULE_PERIPH default y select MODULE_ZTIMER if MODULE_PERIPH_USBDEV select MODULE_ZTIMER_MSEC if MODULE_PERIPH_USBDEV - select MODULE_USBDEV_SYNOPSYS_DWC2 if MODULE_PERIPH_USBDEV && !HAS_CPU_STM32WB && !HAS_CPU_STM32F3 + # All STM32 families except for STM32F1, STM32F3 and STM32WG use + # MODULE_USBDEV_SYNOPSYS_DWC2 + select MODULE_USBDEV_SYNOPSYS_DWC2 if MODULE_PERIPH_USBDEV && !HAS_CPU_STM32WB && !HAS_CPU_STM32F3 && !HAS_CPU_STM32F1 + # NOTE: In STM32F1 family STM32F105xx and STM32F107xx also use + # MODULE_USBDEV_SYNOPSYS_DWC2. Add those MCUs once the are added to + # KConfig help stm32 common peripheral code.