Skip to content

Commit a12658a

Browse files
committed
Replace GCC's objcopy with SDCC's makebin
This reverts commit d36fb62 ("Replace makebin with objcopy"). Using objcopy from GCC 14.2 with the IHX produced by SDCC 4.5.0 results in an incorrectly sized ROM. Revert to using the tool provided by the SDCC toolchain. Produces different `flash.rom` and `scratch.rom`, but `ec.rom` is identical. Signed-off-by: Tim Crawford <[email protected]>
1 parent 890906e commit a12658a

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

src/arch/8051/toolchain.mk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ sim: $(BUILD)/ec.rom
3434

3535
# Convert from Intel Hex file to binary file
3636
$(BUILD)/ec.rom: $(BUILD)/ec.ihx
37-
@echo " OBJCOPY $(subst $(BUILD)/,,$@)"
37+
@echo " MAKEBIN $(subst $(BUILD)/,,$@)"
3838
mkdir -p $(@D)
39-
objcopy -I ihex -O binary --gap-fill=0xFF --pad-to=$(CONFIG_EC_FLASH_SIZE) $< $@
39+
makebin -s $(CONFIG_EC_FLASH_SIZE) $< $@
4040

4141
# Link object files into Intel Hex file
4242
$(BUILD)/ec.ihx: $(OBJ)

src/board/system76/common/flash/flash.mk

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,13 @@ FLASH_CC=\
3535
$(BUILD)/include/flash.h: $(FLASH_BUILD)/flash.rom
3636
@echo " XXD $(subst $(BUILD)/,,$@)"
3737
mkdir -p $(@D)
38-
xxd -include < $< > $@
38+
xxd -include -s $(FLASH_OFFSET) < $< > $@
3939

4040
# Convert from Intel Hex file to binary file
4141
$(FLASH_BUILD)/flash.rom: $(FLASH_BUILD)/flash.ihx
42-
@echo " OBJCOPY $(subst $(BUILD)/,,$@)"
42+
@echo " MAKEBIN $(subst $(BUILD)/,,$@)"
4343
mkdir -p $(@D)
44-
objcopy -I ihex -O binary $< $@
44+
makebin -p $< $@
4545

4646
# Link object files into Intel Hex file
4747
$(FLASH_BUILD)/flash.ihx: $(FLASH_OBJ)

src/board/system76/common/scratch/scratch.mk

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,13 @@ SCRATCH_CC=\
3434
$(BUILD)/include/scratch.h: $(SCRATCH_BUILD)/scratch.rom
3535
@echo " XXD $(subst $(BUILD)/,,$@)"
3636
mkdir -p $(@D)
37-
xxd -include < $< > $@
37+
xxd -include -s $(SCRATCH_OFFSET) < $< > $@
3838

3939
# Convert from Intel Hex file to binary file
4040
$(SCRATCH_BUILD)/scratch.rom: $(SCRATCH_BUILD)/scratch.ihx
41-
@echo " OBJCOPY $(subst $(BUILD)/,,$@)"
41+
@echo " MAKEBIN $(subst $(BUILD)/,,$@)"
4242
mkdir -p $(@D)
43-
objcopy -I ihex -O binary $< $@
43+
makebin -p $< $@
4444

4545
# Link object files into Intel Hex file
4646
$(SCRATCH_BUILD)/scratch.ihx: $(SCRATCH_OBJ)

0 commit comments

Comments
 (0)