Skip to content

Commit fdd82e6

Browse files
committed
F4: Add the STM32_SUBTYPE stuff and fixed linker script lookup to bootloader makefiles.
1 parent 53169e5 commit fdd82e6

2 files changed

Lines changed: 8 additions & 2 deletions

File tree

flight/targets/bl/f4/Makefile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ SRC += pios_usbhook.c
7070
SRC += startup.c
7171
SRC += vectors_stm32f4xx.c
7272

73-
ifneq "$(findstring STM32F40_41xxx,$(STM32_TYPE))" ""
73+
ifneq "$(findstring STM32F405xx,$(STM32_TYPE))" ""
7474
LINKER_SCRIPTS_BL = $(PIOS_DEVLIB)/link_STM32F4xx_BL_memory.ld \
7575
$(PIOS_DEVLIB)/link_STM32F4xx_sections.ld
7676
else ifneq "$(findstring STM32F446xx,$(STM32_TYPE))" ""
@@ -140,6 +140,9 @@ ADEFS = -D__ASSEMBLY__
140140
#
141141
# Flags for C and C++ (arm-elf-gcc/arm-elf-g++)
142142
CFLAGS += -D$(STM32_TYPE)
143+
ifneq ($(STM32_SUBTYPE),)
144+
CFLAGS += -D$(STM32_SUBTYPE)
145+
endif
143146

144147
CFLAGS += -gdwarf-2
145148
CFLAGS += -Os -fconserve-stack

flight/targets/bu/f4/Makefile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,9 @@ PAYLOAD_FILE = $(ROOT_DIR)/build/bl_$(BOARD_NAME)/bl_$(BOARD_NAME).bin
8787
# Place project-specific -D (define) and/or
8888
# -U options for C here.
8989
CDEFS += -D$(STM32_TYPE)
90+
ifneq ($(STM32_SUBTYPE),)
91+
CDEFS += -D$(STM32_SUBTYPE)
92+
endif
9093
CDEFS += -DSYSCLK_FREQ=$(SYSCLK_FREQ)
9194
CDEFS += -DMEM_SIZE=$(FW_BANK_SIZE)
9295
CDEFS += -DUSE_$(BOARD)
@@ -156,7 +159,7 @@ LDFLAGS += -Wl,--warn-common
156159
LDFLAGS += -Wl,--fatal-warnings
157160

158161
# Linker scripts
159-
ifneq "$(findstring STM32F40_41xxx,$(STM32_TYPE))" ""
162+
ifneq "$(findstring STM32F405xx,$(STM32_TYPE))" ""
160163
LINKER_SCRIPTS_APP = $(PIOS_DEVLIB)/link_STM32F4xx_OP_memory.ld \
161164
$(PIOS_DEVLIB)/link_STM32F4xx_sections.ld
162165
else ifneq "$(findstring STM32F446xx,$(STM32_TYPE))" ""

0 commit comments

Comments
 (0)