Question

Is it possible to use the objcopy-parameter --gap-fill only for some specific sections? I don't want to fill up everything with e.g. 0xAA because I want to preserv some old section in my existing EEPROM. It is bad when they are overwritten with e.g. 0xAA. But in some other section I exactly want this behaviour.

Thanks for helping.

Was it helpful?

Solution

You can specify an end address for the padding with: --pad-to

e.g.: avr-objcopy.exe -I ihex -O binary --gap-fill 0xFF --pad-to 0x1FFE fkmegax8.hex fkmegax8.bin

objcopy specification: --gap-fill val Fill gaps between sections with val. This operation applies to the load address (LMA) of the sections. It is done by increasing the size of the section with the lower address, and filling in the extra space created with val. --pad-to address Pad the output file up to the load address address. This is done by increasing the size of the last section. The extra space is filled in with the value specified by `--gap-fill' (default zero).

I put together the final hex file by mergin them with srec_cat.exe.

So if you have the cance to put together your file section by section you can put in your filler bytes after each new gap.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top