From 40dd3bd68ed19b8b7018a17c0c4cca35694d3611 Mon Sep 17 00:00:00 2001 From: Marian Buschsieweke Date: Fri, 14 Oct 2022 12:25:57 +0200 Subject: [PATCH] cpu/stm32: fix periph_usb modeling for STM32F1 - Fix source selection for STM32F105xx and STM32F107xx - Fix KConfig modeling for STM32F105xx and STM32F107xx --- cpu/stm32/periph/Kconfig | 15 ++++++++++++--- cpu/stm32/periph/Makefile | 2 +- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/cpu/stm32/periph/Kconfig b/cpu/stm32/periph/Kconfig index 83af95ccde..9c81d3d51a 100644 --- a/cpu/stm32/periph/Kconfig +++ b/cpu/stm32/periph/Kconfig @@ -13,9 +13,18 @@ config MODULE_PERIPH # 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 + # In STM32F1 family STM32F105xx also uses MODULE_USBDEV_SYNOPSYS_DWC2. + select MODULE_USBDEV_SYNOPSYS_DWC2 if MODULE_PERIPH_USBDEV && CPU_MODEL_STM32F105R8 + select MODULE_USBDEV_SYNOPSYS_DWC2 if MODULE_PERIPH_USBDEV && CPU_MODEL_STM32F105RB + select MODULE_USBDEV_SYNOPSYS_DWC2 if MODULE_PERIPH_USBDEV && CPU_MODEL_STM32F105RC + select MODULE_USBDEV_SYNOPSYS_DWC2 if MODULE_PERIPH_USBDEV && CPU_MODEL_STM32F105V8 + select MODULE_USBDEV_SYNOPSYS_DWC2 if MODULE_PERIPH_USBDEV && CPU_MODEL_STM32F105VB + select MODULE_USBDEV_SYNOPSYS_DWC2 if MODULE_PERIPH_USBDEV && CPU_MODEL_STM32F105VC + # In STM32F1 family STM32F107xx also uses MODULE_USBDEV_SYNOPSYS_DWC2. + select MODULE_USBDEV_SYNOPSYS_DWC2 if MODULE_PERIPH_USBDEV && CPU_MODEL_STM32F107RB + select MODULE_USBDEV_SYNOPSYS_DWC2 if MODULE_PERIPH_USBDEV && CPU_MODEL_STM32F107RC + select MODULE_USBDEV_SYNOPSYS_DWC2 if MODULE_PERIPH_USBDEV && CPU_MODEL_STM32F107VB + select MODULE_USBDEV_SYNOPSYS_DWC2 if MODULE_PERIPH_USBDEV && CPU_MODEL_STM32F107VC help stm32 common peripheral code. diff --git a/cpu/stm32/periph/Makefile b/cpu/stm32/periph/Makefile index 91be0f8c93..04d0989545 100644 --- a/cpu/stm32/periph/Makefile +++ b/cpu/stm32/periph/Makefile @@ -51,7 +51,7 @@ endif # Select the correct implementation for `periph_usbdev` ifneq (,$(filter periph_usbdev,$(USEMODULE))) - ifneq (,$(filter f1 f3 wb,$(CPU_FAM))) + ifeq (,$(filter usbdev_synopsys_dwc2,$(USEMODULE))) SRC += usbdev_fs.c endif endif