Skip to content

Commit

Permalink
F4: Add the STM32_SUBTYPE stuff and fixed linker script lookup to boo…
Browse files Browse the repository at this point in the history
…tloader makefiles.
  • Loading branch information
glowtape committed Jan 5, 2018
1 parent 53169e5 commit fdd82e6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion flight/targets/bl/f4/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ SRC += pios_usbhook.c
SRC += startup.c
SRC += vectors_stm32f4xx.c

ifneq "$(findstring STM32F40_41xxx,$(STM32_TYPE))" ""
ifneq "$(findstring STM32F405xx,$(STM32_TYPE))" ""
LINKER_SCRIPTS_BL = $(PIOS_DEVLIB)/link_STM32F4xx_BL_memory.ld \
$(PIOS_DEVLIB)/link_STM32F4xx_sections.ld
else ifneq "$(findstring STM32F446xx,$(STM32_TYPE))" ""
Expand Down Expand Up @@ -140,6 +140,9 @@ ADEFS = -D__ASSEMBLY__
#
# Flags for C and C++ (arm-elf-gcc/arm-elf-g++)
CFLAGS += -D$(STM32_TYPE)
ifneq ($(STM32_SUBTYPE),)
CFLAGS += -D$(STM32_SUBTYPE)
endif

CFLAGS += -gdwarf-2
CFLAGS += -Os -fconserve-stack
Expand Down
5 changes: 4 additions & 1 deletion flight/targets/bu/f4/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,9 @@ PAYLOAD_FILE = $(ROOT_DIR)/build/bl_$(BOARD_NAME)/bl_$(BOARD_NAME).bin
# Place project-specific -D (define) and/or
# -U options for C here.
CDEFS += -D$(STM32_TYPE)
ifneq ($(STM32_SUBTYPE),)
CDEFS += -D$(STM32_SUBTYPE)
endif
CDEFS += -DSYSCLK_FREQ=$(SYSCLK_FREQ)
CDEFS += -DMEM_SIZE=$(FW_BANK_SIZE)
CDEFS += -DUSE_$(BOARD)
Expand Down Expand Up @@ -156,7 +159,7 @@ LDFLAGS += -Wl,--warn-common
LDFLAGS += -Wl,--fatal-warnings

# Linker scripts
ifneq "$(findstring STM32F40_41xxx,$(STM32_TYPE))" ""
ifneq "$(findstring STM32F405xx,$(STM32_TYPE))" ""
LINKER_SCRIPTS_APP = $(PIOS_DEVLIB)/link_STM32F4xx_OP_memory.ld \
$(PIOS_DEVLIB)/link_STM32F4xx_sections.ld
else ifneq "$(findstring STM32F446xx,$(STM32_TYPE))" ""
Expand Down

0 comments on commit fdd82e6

Please sign in to comment.