You copied the Doc URL to your clipboard.

Converting an ELF image to plain binary format

Use the --bin option to produce plain binary output, one file for each load region. However, a file is not created for a load region if all the execution regions within that load region are empty.

You can split the output from this option into multiple files with the --widthxbanks option.

Use the --bincombined option to produce plain binary output. It generates one output file for an image containing multiple load regions. By default, the start address of the first load region in memory is used as the base address. fromelf inserts padding between load regions as required to ensure that they are at the correct relative offset from each other. Separating the load regions in this way means that the output file can be loaded into memory and correctly aligned starting at the base address.

Use the --bincombined option with --bincombined_base and --bincombined_padding to change the default values for the base address and padding.

Be aware of the following when using these options:

  • You must use the --output option with --bin and --bincombined.

  • For --bincombined, if you use a scatter file that defines two load regions with a large address space between them, the resulting binary can be very large because it contains mostly padding. For example, if you have a load region of size 0x100 bytes at address 0x00000000 and another load region at address 0x30000000, the amount of padding is 0x2FFFFFF00 bytes.


To convert an ELF file to a plain binary file, for example outfile.bin, enter:

fromelf --cpu=8-A.64 --bin --output=out.bin in.axf

To produce a binary file that can be loaded at start address 0x1000, enter:

fromelf --cpu=8-A.64 --bincombined --bincombined_base=0x1000 --output=out.bin in.axf

To produce plain binary output and fill the space between load regions with copies of the 32-bit word 0x12345678, enter:

fromelf --cpu=8-A.64 --bincombined --bincombined_padding=4,0x12345678 --output=out.bin in.axf