From 577d57ea7028b395f22932aaa5834ce68a44c74c Mon Sep 17 00:00:00 2001 From: Dominic Clifton Date: Thu, 8 Aug 2019 01:26:34 +0200 Subject: [PATCH] EXST - Ensure HEX files are suitable for flashing using the configurator. Without the padding and length the HASH in the HEX will be invalid since erased flash defaults to 0xFF but the hash is created on the binary file which has a default of 0x00 for un-filled data. --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 0c6212e381..9e663fc9ad 100644 --- a/Makefile +++ b/Makefile @@ -352,7 +352,7 @@ $(TARGET_HEX): $(TARGET_BIN) $(if $(EXST_ADJUST_VMA),,$(error "EXST_ADJUST_VMA not specified")) @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) $@ + $(V1) $(OBJCOPY) -O ihex --adjust-vma=$(EXST_ADJUST_VMA) --gap-fill=0x00 --pad-to=$(shell echo "$(FIRMWARE_SIZE)" | awk '{printf("0x%08x", (1024*$$1) + $(EXST_ADJUST_VMA));}') $(TARGET_EXST_ELF) $@ endif