Commit ea2abefd authored by miller's avatar miller

Workaround for STM32 dfu bootloader bug:

pad .raw and .hex sizes to multiple of 8 bytes.
[See ST App Note AN2606]
parent dcae84cb
......@@ -2393,5 +2393,6 @@
:109548000000000000000000000000000000000013
:109558000000000000000000000000000000000003
:0C956800000000000000000008180020B7
:0495740000000000F3
:040000050800018D61
:00000001FF
......@@ -96,9 +96,10 @@ $(OBJ_DIR)/%.o: %.c
$(OBJ_DIR)/%.o: %.s
$(CC) -c $(CPPFLAGS) $(CFLAGS) $< -o $@
PAD = $(OUTPUT_DIR)/$(TARGET).pad
$(OUTPUT_DIR)/$(TARGET).elf : $(LIB) $(ASM_OBJECTS) $(SRC_OBJECTS) $(LDSCRIPT)
$(CC) $(LDFLAGS) $(ASM_OBJECTS) $(SRC_OBJECTS) $(LIB) -T$(LDSCRIPT) -o $@
arm-none-eabi-size $@ | tail -1 | awk '{printf "0x%x\n",int((0x08000000+$$1+$$2+7)/8)*8}' > $(PAD)
# dependency rules
......@@ -121,10 +122,10 @@ $(LIB): $(LIB_OBJECTS)
.INTERMEDIATE: $(LIB_OBJECTS)
$(OUTPUT_DIR)/$(TARGET).hex : $(OUTPUT_DIR)/$(TARGET).elf
arm-none-eabi-objcopy -O ihex $< $@
arm-none-eabi-objcopy -O ihex --pad-to `cat $(PAD)` $< $@
$(OUTPUT_DIR)/$(TARGET).raw: $(OUTPUT_DIR)/$(TARGET).elf
arm-none-eabi-objcopy -O binary $< $@
arm-none-eabi-objcopy -O binary --pad-to `cat $(PAD)` $< $@
# top-level targets
clean:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment