Skip to content

Commit 842e361

Browse files
iabdalkaderdpgeorge
authored andcommitted
renesas-ra/Makefile: Remove id_code section from binary file generation.
The linker scripts for most of these microcontrollers contain a non-contiguous flash section for the ID code that results in big binary files, which exceed the flash size. This commit removes the ID code section from the main firmware binary, and outputs it to a separate binary, which can be deployed manually if ID code is enabled. Signed-off-by: iabdalkader <[email protected]>
1 parent b675c87 commit 842e361

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

ports/renesas-ra/Makefile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -442,7 +442,8 @@ endef
442442

443443
define GENERATE_BIN
444444
$(ECHO) "GEN $(1)"
445-
$(Q)$(OBJCOPY) -I ihex -O binary $(2) $(1)
445+
$(Q)$(OBJCOPY) -O binary -j .id_code $(2) $(BUILD)/id_code.bin
446+
$(Q)$(OBJCOPY) -O binary --remove-section=.id_code $(2) $(1)
446447
endef
447448

448449
define GENERATE_HEX
@@ -452,7 +453,7 @@ endef
452453

453454
.PHONY:
454455

455-
$(BUILD)/firmware.bin: $(BUILD)/firmware.hex
456+
$(BUILD)/firmware.bin: $(BUILD)/firmware.elf
456457
$(call GENERATE_BIN,$@,$^)
457458

458459
$(BUILD)/firmware.hex: $(BUILD)/firmware.elf

0 commit comments

Comments
 (0)