2

For a bootloader (PIC32) i do need only a certain memory area from a binary file (application for a bootloader, config and bootloader are located elsewhere, no hex possible). If i call the xc32-objcpy on a hex or elf file it will create a 44MB binary of the whole address space.

What i need is only a certain memory area (kesg0_program_mem) where the application is located. Of course i could create the 44MB binary and then cutout a certain address range, but is there no option to directly output the area of interest? The program mempory is stricly defined:

kseg0_program_mem     (rx)  : ORIGIN = 0x9FC01000, LENGTH = 0xFF00-0x1000

I tried getting only the sections from the Linker file but that is tedious even with wildcards (see below, incomplete).

-I ihex -O binary -j .text -j .data -j .rodata -j .reset -j .bev_excpt -j simple_tlb_refil -j .cache_err_excpt -j app_excpt -j .vectors Test.X.production.hex Test.X.production.bin

I am open to any but it would be helpful if it can be done by the command line

pfried
  • 163
  • 4
  • Why not `-j kseg0_program_mem`? – m.Alin Dec 13 '16 at 14:26
  • `kseg0_program_mem` is a memory area not a section, the `-j`option keeps sections (terminology from the linker scripts). It outputs a 0 bytes file if i try that – pfried Dec 13 '16 at 16:49

0 Answers0