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 <i.abdalkader@gmail.com>
This commit is contained in:
iabdalkader
2024-12-11 13:17:47 +01:00
committed by Damien George
parent b675c87992
commit 842e3617a0

View File

@@ -442,7 +442,8 @@ endef
define GENERATE_BIN
$(ECHO) "GEN $(1)"
$(Q)$(OBJCOPY) -I ihex -O binary $(2) $(1)
$(Q)$(OBJCOPY) -O binary -j .id_code $(2) $(BUILD)/id_code.bin
$(Q)$(OBJCOPY) -O binary --remove-section=.id_code $(2) $(1)
endef
define GENERATE_HEX
@@ -452,7 +453,7 @@ endef
.PHONY:
$(BUILD)/firmware.bin: $(BUILD)/firmware.hex
$(BUILD)/firmware.bin: $(BUILD)/firmware.elf
$(call GENERATE_BIN,$@,$^)
$(BUILD)/firmware.hex: $(BUILD)/firmware.elf