summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2019-07-03 23:42:36 +1000
committerDamien George <damien.p.george@gmail.com>2019-07-03 23:42:36 +1000
commit6b6403ce76e11fd564d9bbe90f190c99fe4e4fa2 (patch)
treede7a7f9c2a062e3928ac1dba9d45ad9ce58b7c59
parent241e57775359bc55738cb56b044ba4cc9056eba5 (diff)
stm32/Makefile: Use startup_stm32*.s file from stm32lib.
This means that each MCU now gets a unique IRQ table, eg a specific one for STM32F405, STM32F411, etc rather than just STM32F4xx.
-rw-r--r--ports/stm32/Makefile7
1 files changed, 4 insertions, 3 deletions
diff --git a/ports/stm32/Makefile b/ports/stm32/Makefile
index 45d4653db..3967e6311 100644
--- a/ports/stm32/Makefile
+++ b/ports/stm32/Makefile
@@ -24,9 +24,11 @@ FROZEN_MPY_DIR ?= modules
# include py core make definitions
include $(TOP)/py/py.mk
+MCU_SERIES_UPPER = $(shell echo $(MCU_SERIES) | tr '[:lower:]' '[:upper:]')
+CMSIS_MCU_LOWER = $(shell echo $(CMSIS_MCU) | tr '[:upper:]' '[:lower:]')
+
LD_DIR=boards
CMSIS_DIR=$(TOP)/lib/stm32lib/CMSIS/STM32$(MCU_SERIES_UPPER)xx/Include
-MCU_SERIES_UPPER = $(shell echo $(MCU_SERIES) | tr '[:lower:]' '[:upper:]')
HAL_DIR=lib/stm32lib/STM32$(MCU_SERIES_UPPER)xx_HAL_Driver
USBDEV_DIR=usbdev
#USBHOST_DIR=usbhost
@@ -40,7 +42,7 @@ DEVICE=0483:df11
STFLASH ?= st-flash
OPENOCD ?= openocd
OPENOCD_CONFIG ?= boards/openocd_stm32f4.cfg
-STARTUP_FILE ?= boards/startup_stm32$(MCU_SERIES).o
+STARTUP_FILE ?= lib/stm32lib/CMSIS/STM32$(MCU_SERIES_UPPER)xx/Source/Templates/gcc/startup_$(CMSIS_MCU_LOWER).o
# Select the cross compile prefix
CROSS_COMPILE ?= arm-none-eabi-
@@ -576,7 +578,6 @@ GEN_PLLFREQTABLE_HDR = $(HEADER_BUILD)/pllfreqtable.h
GEN_STMCONST_HDR = $(HEADER_BUILD)/modstm_const.h
GEN_STMCONST_QSTR = $(BUILD)/modstm_qstr.h
GEN_STMCONST_MPZ = $(HEADER_BUILD)/modstm_mpz.h
-CMSIS_MCU_LOWER = $(shell echo $(CMSIS_MCU) | tr '[:upper:]' '[:lower:]')
CMSIS_MCU_HDR = $(CMSIS_DIR)/$(CMSIS_MCU_LOWER).h
modmachine.c: $(GEN_PLLFREQTABLE_HDR)