Skip to content

Commit

Permalink
FIX: USE_STDPERIPH_DRIVER incorrectly defined for all targets (legacy) (
Browse files Browse the repository at this point in the history
  • Loading branch information
blckmn authored Jan 18, 2025
1 parent 98283ff commit b2bafa1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
1 change: 0 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,6 @@ CFLAGS += $(ARCH_FLAGS) \
$(TEMPORARY_FLAGS) \
$(DEVICE_FLAGS) \
-D_GNU_SOURCE \
-DUSE_STDPERIPH_DRIVER \
-D$(TARGET) \
$(TARGET_FLAGS) \
-D'__FORKNAME__="$(FORKNAME)"' \
Expand Down
12 changes: 8 additions & 4 deletions src/platform/STM32/mk/STM32F4.mk
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ STDPERIPH_SRC = \
VPATH := $(VPATH):$(STDPERIPH_DIR)/src
endif

DEVICE_FLAGS = -DSTM32F4

ifneq ($(TARGET_MCU),$(filter $(TARGET_MCU),STM32F411xE STM32F446xx))
STDPERIPH_SRC += stm32f4xx_fsmc.c
endif
Expand Down Expand Up @@ -141,33 +143,35 @@ INCLUDE_DIRS := \
$(CMSIS_DIR)/Core/Include \
$(LIB_MAIN_DIR)/STM32F4/Drivers/CMSIS/Device/ST/STM32F4xx \
$(TARGET_PLATFORM_DIR)/vcpf4

DEVICE_FLAGS += -DUSE_STDPERIPH_DRIVER
endif

#Flags
ARCH_FLAGS = -mthumb -mcpu=cortex-m4 -march=armv7e-m -mfloat-abi=hard -mfpu=fpv4-sp-d16 -fsingle-precision-constant

ifeq ($(TARGET_MCU),STM32F411xE)
DEVICE_FLAGS = -DSTM32F411xE -finline-limit=20
DEVICE_FLAGS += -DSTM32F411xE -finline-limit=20
LD_SCRIPT = $(LINKER_DIR)/stm32_flash_f411.ld
STARTUP_SRC = STM32/startup/startup_stm32f411xe.s
MCU_FLASH_SIZE := 512

else ifeq ($(TARGET_MCU),STM32F405xx)
DEVICE_FLAGS = -DSTM32F40_41xxx -DSTM32F405xx
DEVICE_FLAGS += -DSTM32F40_41xxx -DSTM32F405xx
LD_SCRIPT = $(LINKER_DIR)/stm32_flash_f405.ld
STARTUP_SRC = STM32/startup/startup_stm32f40xx.s
MCU_FLASH_SIZE := 1024

else ifeq ($(TARGET_MCU),STM32F446xx)
DEVICE_FLAGS = -DSTM32F446xx
DEVICE_FLAGS += -DSTM32F446xx
LD_SCRIPT = $(LINKER_DIR)/stm32_flash_f446.ld
STARTUP_SRC = STM32/startup/startup_stm32f446xx.s
MCU_FLASH_SIZE := 512

else
$(error Unknown MCU for F4 target)
endif
DEVICE_FLAGS += -DHSE_VALUE=$(HSE_VALUE) -DSTM32
DEVICE_FLAGS += -DHSE_VALUE=$(HSE_VALUE)

MCU_COMMON_SRC = \
common/stm32/system.c \
Expand Down

0 comments on commit b2bafa1

Please sign in to comment.