EXST - Allow targets to specify VMA offset.

The hex file must have the correct address in order for it to be
uploaded via flashing tools (configurator).

However, the objcopy tool only appears to support an INCREMENT address,
so the increment is determined by subtracting the load address from the
flash address.

For the current SPRacing H7 boards, the bootloader DFU descriptor string
has a start address of 0x9000000 for the external flash, the firmware
partition begins at offset 0x07CE0000, required resulting flash address
is 0x97CE0000.
This commit is contained in:
Dominic Clifton 2019-08-07 15:22:34 +02:00
parent 09c98513b8
commit 871486527b
4 changed files with 11 additions and 2 deletions

View File

@ -349,8 +349,10 @@ $(TARGET_BIN): $(TARGET_UNPATCHED_BIN)
$(OBJCOPY) $(TARGET_ELF) $(TARGET_EXST_ELF) --update-section .exst_hash=$(TARGET_EXST_HASH_SECTION_FILE) $(OBJCOPY) $(TARGET_ELF) $(TARGET_EXST_ELF) --update-section .exst_hash=$(TARGET_EXST_HASH_SECTION_FILE)
$(TARGET_HEX): $(TARGET_BIN) $(TARGET_HEX): $(TARGET_BIN)
@echo "Creating EXST HEX from patched EXST ELF $(TARGET_HEX)" "$(STDOUT)" $(if $(EXST_ADJUST_VMA),,$(error "EXST_ADJUST_VMA not specified"))
$(V1) $(OBJCOPY) -O ihex --set-start 0x8000000 $(TARGET_EXST_ELF) $@
@echo "Creating EXST HEX from patched EXST ELF $(TARGET_HEX), VMA Adjust $(EXST_ADJUST_VMA)" "$(STDOUT)"
$(V1) $(OBJCOPY) -O ihex --adjust-vma $(EXST_ADJUST_VMA) $(TARGET_EXST_ELF) $@
endif endif

View File

@ -5,6 +5,9 @@ HSE_VALUE = 8000000
FEATURES += VCP ONBOARDFLASH SDCARD_SDIO FEATURES += VCP ONBOARDFLASH SDCARD_SDIO
EXST = yes EXST = yes
# flash address 0x97CE0000 - code_ram address (0x24010000) = 0x73CD0000
EXST_ADJUST_VMA = 0x73CD0000
TARGET_SRC += \ TARGET_SRC += \
drivers/bus_quadspi_hal.c \ drivers/bus_quadspi_hal.c \

View File

@ -3,6 +3,8 @@ H750xB_TARGETS += $(TARGET)
HSE_VALUE = 8000000 HSE_VALUE = 8000000
EXST = yes EXST = yes
# flash address 0x97CE0000 - code_ram address (0x24010000) = 0x73CD0000
EXST_ADJUST_VMA = 0x73CD0000
FEATURES += VCP ONBOARDFLASH FEATURES += VCP ONBOARDFLASH

View File

@ -3,6 +3,8 @@ H750xB_TARGETS += $(TARGET)
HSE_VALUE = 8000000 HSE_VALUE = 8000000
EXST = yes EXST = yes
# flash address 0x97CE0000 - code_ram address (0x24010000) = 0x73CD0000
EXST_ADJUST_VMA = 0x73CD0000
FEATURES += VCP ONBOARDFLASH SDCARD_SDIO FEATURES += VCP ONBOARDFLASH SDCARD_SDIO