diff --git a/cpu/stm32_common/Makefile.include b/cpu/stm32_common/Makefile.include index 6fe4747cd9..13ce83f9c2 100644 --- a/cpu/stm32_common/Makefile.include +++ b/cpu/stm32_common/Makefile.include @@ -8,12 +8,6 @@ USEMODULE += periph_common # include stm32 common functions and stm32 common periph drivers USEMODULE += stm32_common stm32_common_periph -# flashpage and eeprom periph implementations share flash lock/unlock functions -# in periph_flash_common -ifneq (,$(filter periph_flashpage periph_eeprom,$(FEATURES_REQUIRED))) - FEATURES_REQUIRED += periph_flash_common -endif - # For stm32 cpu's we use the stm32_common.ld linker script export LINKFLAGS += -L$(RIOTCPU)/stm32_common/ldscripts LINKER_SCRIPT ?= stm32_common.ld diff --git a/cpu/stm32_common/periph/Makefile b/cpu/stm32_common/periph/Makefile index d549119759..f4c1ed49c2 100644 --- a/cpu/stm32_common/periph/Makefile +++ b/cpu/stm32_common/periph/Makefile @@ -9,4 +9,10 @@ ifneq (,$(filter periph_i2c,$(USEMODULE))) endif endif +# flashpage and eeprom periph implementations share flash lock/unlock functions +# defined in flash_common.c +ifneq (,$(filter periph_flashpage periph_eeprom,$(USEMODULE))) + SRC += flash_common.c +endif + include $(RIOTMAKE)/periph.mk diff --git a/cpu/stm32f0/Makefile.features b/cpu/stm32f0/Makefile.features index e2a50dd865..d286ea06f2 100644 --- a/cpu/stm32f0/Makefile.features +++ b/cpu/stm32f0/Makefile.features @@ -1,5 +1,4 @@ ifeq (,$(filter nucleo-f031k6,$(BOARD))) - FEATURES_PROVIDED += periph_flash_common FEATURES_PROVIDED += periph_flashpage FEATURES_PROVIDED += periph_flashpage_raw endif diff --git a/cpu/stm32f1/Makefile.features b/cpu/stm32f1/Makefile.features index e5e8c0f6d8..5e5e8b9118 100644 --- a/cpu/stm32f1/Makefile.features +++ b/cpu/stm32f1/Makefile.features @@ -1,4 +1,3 @@ -FEATURES_PROVIDED += periph_flash_common FEATURES_PROVIDED += periph_flashpage FEATURES_PROVIDED += periph_flashpage_raw diff --git a/cpu/stm32l0/Makefile.features b/cpu/stm32l0/Makefile.features index 5c7e361aee..d76642f390 100644 --- a/cpu/stm32l0/Makefile.features +++ b/cpu/stm32l0/Makefile.features @@ -1,5 +1,4 @@ FEATURES_PROVIDED += periph_eeprom -FEATURES_PROVIDED += periph_flash_common FEATURES_PROVIDED += periph_flashpage FEATURES_PROVIDED += periph_flashpage_raw FEATURES_PROVIDED += periph_hwrng diff --git a/cpu/stm32l1/Makefile.features b/cpu/stm32l1/Makefile.features index d93fc23829..e13289086a 100644 --- a/cpu/stm32l1/Makefile.features +++ b/cpu/stm32l1/Makefile.features @@ -1,5 +1,4 @@ FEATURES_PROVIDED += periph_eeprom -FEATURES_PROVIDED += periph_flash_common FEATURES_PROVIDED += periph_flashpage FEATURES_PROVIDED += periph_flashpage_raw diff --git a/cpu/stm32l4/Makefile.features b/cpu/stm32l4/Makefile.features index f4388f2759..baed9e6078 100644 --- a/cpu/stm32l4/Makefile.features +++ b/cpu/stm32l4/Makefile.features @@ -1,4 +1,3 @@ -FEATURES_PROVIDED += periph_flash_common FEATURES_PROVIDED += periph_flashpage FEATURES_PROVIDED += periph_flashpage_raw FEATURES_PROVIDED += periph_hwrng