Skip to content

Commit

Permalink
cpu/stm32: fix KConfig modeling for STM32F1 / usbdev_synopsys_dwc2
Browse files Browse the repository at this point in the history
This fixes incorrect module selection for STM32F1 boards with feature
periph_usbdev, a regression introduced by
RIOT-OS#17812
  • Loading branch information
maribu committed Oct 14, 2022
1 parent ea0a535 commit 763bb58
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
6 changes: 5 additions & 1 deletion cpu/stm32/Makefile.dep
Original file line number Diff line number Diff line change
Expand Up @@ -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 stm32f103% stm32f105%,$(CPU_MODEL)))
USEMODULE += usbdev_synopsys_dwc2
endif
USEMODULE += ztimer
USEMODULE += ztimer_msec
endif
Expand Down
7 changes: 6 additions & 1 deletion cpu/stm32/periph/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down

0 comments on commit 763bb58

Please sign in to comment.