Skip to content

Commit

Permalink
Pad binary file to total flash size
Browse files Browse the repository at this point in the history
Signed-off-by: Tim Crawford <tcrawford@system76.com>
  • Loading branch information
crawfxrd authored and jackpot51 committed Jul 19, 2023
1 parent 64e5b83 commit 0d83819
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/arch/8051/toolchain.mk
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ sim: $(BUILD)/ec.rom
$(BUILD)/ec.rom: $(BUILD)/ec.ihx
@echo " OBJCOPY $(subst $(obj)/,,$@)"
mkdir -p $(@D)
objcopy -I ihex -O binary --gap-fill=0xFF $< $@
objcopy -I ihex -O binary --gap-fill=0xFF --pad-to=$(CONFIG_EC_FLASH_SIZE) $< $@

# Link object files into Intel Hex file
$(BUILD)/ec.ihx: $(OBJ)
Expand Down
3 changes: 3 additions & 0 deletions src/ec/ite/ec.mk
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,6 @@ ARCH=8051

# 64 KB is the max without banking
CODE_SIZE=65536

# Total flash size: 128 KiB
CONFIG_EC_FLASH_SIZE = 131072

0 comments on commit 0d83819

Please sign in to comment.