Replace makebin with objcopy
Replace custom SDCC tool with the more standard binutils tool. scratch.rom and flash.rom are different (no unnecessary padding), but resulting ec.rom is the same. Signed-off-by: Tim Crawford <tcrawford@system76.com>
This commit is contained in:
committed by
Tim Crawford
parent
69f97fe149
commit
d36fb62cd7
@@ -14,7 +14,7 @@ sim: $(BUILD)/ec.rom
|
||||
# Convert from Intel Hex file to binary file
|
||||
$(BUILD)/ec.rom: $(BUILD)/ec.ihx
|
||||
@mkdir -p $(@D)
|
||||
makebin -s $(CODE_SIZE) -p < $< > $@
|
||||
objcopy -I ihex -O binary --gap-fill=0xFF $< $@
|
||||
|
||||
# Link object files into Intel Hex file
|
||||
$(BUILD)/ec.ihx: $(OBJ)
|
||||
|
@@ -2,6 +2,7 @@
|
||||
|
||||
CC=avr-gcc -mmcu=$(EC_VARIANT)
|
||||
CFLAGS+=-Os -fstack-usage -Wall -Werror -Wl,--gc-sections -Wl,-u,vfprintf -lprintf_flt
|
||||
OBJCOPY = avr-objcopy
|
||||
OBJ=$(sort $(patsubst src/%.c,$(BUILD)/%.o,$(SRC)))
|
||||
|
||||
# Run EC rom in simulator
|
||||
@@ -11,12 +12,12 @@ sim: $(BUILD)/ec.elf
|
||||
# Convert from Intel Hex file to binary file
|
||||
$(BUILD)/ec.rom: $(BUILD)/ec.ihx
|
||||
@mkdir -p $(@D)
|
||||
makebin -p < $< > $@
|
||||
$(OBJCOPY) -I ihex -O binary --gap-fill 0xFF $< $@
|
||||
|
||||
# Convert from ELF file to Intel Hex file
|
||||
$(BUILD)/ec.ihx: $(BUILD)/ec.elf
|
||||
@mkdir -p $(@D)
|
||||
avr-objcopy -j .text -j .data -O ihex $< $@
|
||||
$(OBJCOPY) -j .text -j .data -O ihex $< $@
|
||||
|
||||
# Link object files into ELF file
|
||||
$(BUILD)/ec.elf: $(OBJ)
|
||||
|
Reference in New Issue
Block a user