H7 build script updates (#8492)

H7 build script updates
This commit is contained in:
Michael Keller 2019-06-28 19:23:20 +12:00 committed by GitHub
commit 9b04b5ebd7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 19 additions and 11 deletions

View File

@ -159,22 +159,26 @@ DEVICE_FLAGS = -DUSE_HAL_DRIVER -DUSE_DMA_RAM
# H750xB : 128K FLASH, 1M RAM # H750xB : 128K FLASH, 1M RAM
# #
ifeq ($(TARGET),$(filter $(TARGET),$(H743xI_TARGETS))) ifeq ($(TARGET),$(filter $(TARGET),$(H743xI_TARGETS)))
DEVICE_FLAGS += -DSTM32H743xx DEVICE_FLAGS += -DSTM32H743xx
LD_SCRIPT = $(LINKER_DIR)/stm32_flash_h743_2m.ld DEFAULT_LD_SCRIPT = $(LINKER_DIR)/stm32_flash_h743_2m.ld
STARTUP_SRC = startup_stm32h743xx.s STARTUP_SRC = startup_stm32h743xx.s
TARGET_FLASH := 2048 TARGET_FLASH := 2048
else ifeq ($(TARGET),$(filter $(TARGET),$(H750xB_TARGETS))) else ifeq ($(TARGET),$(filter $(TARGET),$(H750xB_TARGETS)))
DEVICE_FLAGS += -DSTM32H750xx DEVICE_FLAGS += -DSTM32H750xx
LD_SCRIPT = $(LINKER_DIR)/stm32_flash_h750_128k.ld DEFAULT_LD_SCRIPT = $(LINKER_DIR)/stm32_flash_h750_128k.ld
STARTUP_SRC = startup_stm32h743xx.s STARTUP_SRC = startup_stm32h743xx.s
TARGET_FLASH := 128 DEFAULT_TARGET_FLASH := 128
ifeq ($(TARGET_FLASH),)
TARGET_FLASH := $(DEFAULT_TARGET_FLASH)
endif
ifeq ($(EXST),yes) ifeq ($(EXST),yes)
FIRMWARE_SIZE := 448 FIRMWARE_SIZE := 448
# TARGET_FLASH now becomes the amount of RAM memory that is occupied by the firmware # TARGET_FLASH now becomes the amount of RAM memory that is occupied by the firmware
# and the maximum size of the data stored on the external storage device. # and the maximum size of the data stored on the external storage device.
TARGET_FLASH := FIRMWARE_SIZE TARGET_FLASH := FIRMWARE_SIZE
LD_SCRIPT = $(LINKER_DIR)/stm32_flash_h750_exst.ld DEFAULT_LD_SCRIPT = $(LINKER_DIR)/stm32_flash_h750_exst.ld
endif endif
ifneq ($(DEBUG),GDB) ifneq ($(DEBUG),GDB)
@ -189,6 +193,10 @@ else
$(error Unknown MCU for H7 target) $(error Unknown MCU for H7 target)
endif endif
ifeq ($(LD_SCRIPT),)
LD_SCRIPT = $(DEFAULT_LD_SCRIPT)
endif
ifneq ($(FIRMWARE_SIZE),) ifneq ($(FIRMWARE_SIZE),)
DEVICE_FLAGS += -DFIRMWARE_SIZE=$(FIRMWARE_SIZE) DEVICE_FLAGS += -DFIRMWARE_SIZE=$(FIRMWARE_SIZE)
endif endif