Skip to content

Commit 342539b

Browse files
committed
stm32/mboot: Use STARTUP_FILE from stm32lib.
1 parent 5a81d2d commit 342539b

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

ports/stm32/mboot/Makefile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,10 @@ endif
2020
include ../../../py/mkenv.mk
2121
include $(BOARD_DIR)/mpconfigboard.mk
2222

23-
CMSIS_DIR=$(TOP)/lib/stm32lib/CMSIS/STM32$(MCU_SERIES_UPPER)xx/Include
2423
MCU_SERIES_UPPER = $(shell echo $(MCU_SERIES) | tr '[:lower:]' '[:upper:]')
24+
CMSIS_MCU_LOWER = $(shell echo $(CMSIS_MCU) | tr '[:upper:]' '[:lower:]')
25+
26+
CMSIS_DIR=$(TOP)/lib/stm32lib/CMSIS/STM32$(MCU_SERIES_UPPER)xx/Include
2527
HAL_DIR=lib/stm32lib/STM32$(MCU_SERIES_UPPER)xx_HAL_Driver
2628
USBDEV_DIR=usbdev
2729
DFU=$(TOP)/tools/dfu.py
@@ -30,6 +32,7 @@ DEVICE=0483:df11
3032
STFLASH ?= st-flash
3133
OPENOCD ?= openocd
3234
OPENOCD_CONFIG ?= boards/openocd_stm32f4.cfg
35+
STARTUP_FILE ?= lib/stm32lib/CMSIS/STM32$(MCU_SERIES_UPPER)xx/Source/Templates/gcc/startup_$(CMSIS_MCU_LOWER).o
3336

3437
CROSS_COMPILE = arm-none-eabi-
3538

@@ -101,7 +104,7 @@ SRC_C = \
101104
$(wildcard $(BOARD_DIR)/*.c)
102105

103106
SRC_O = \
104-
ports/stm32/boards/startup_stm32$(MCU_SERIES).o \
107+
$(STARTUP_FILE) \
105108
ports/stm32/resethandler.o \
106109

107110
$(BUILD)/$(HAL_DIR)/Src/stm32$(MCU_SERIES)xx_ll_usb.o: CFLAGS += -Wno-attributes

0 commit comments

Comments
 (0)