Keil Logo


3.6 --cad

Produces a C array definition or C++ array definition containing binary output.


You can use each array definition in the source code of another application. For example, you might want to embed an image in the address space of another application, such as an embedded operating system.
If your image has a single load region, the output is directed to stdout by default. To save the output to a file, use the --output option together with a filename.
If your image has multiple load regions, then you must also use the --output option together with a directory name. Unless you specify a full path name, the path is relative to the current directory. A file is created for each load region in the specified directory. The name of each file is the name of the corresponding execution region.
Use this option with --output to generate one output file for each load region in the image.


You cannot use this option with object files.

Considerations when using --cad

A file is only created when the load region describes code or data that is present in the ELF file. For example a load region containing only execution regions with ZI data in them does not result in a output file.


The following examples show how to use --cad:
  • To produce an array definition for an image that has a single load region, enter:
    fromelf --cad myimage.axf
    unsigned char LR0[] = {
  • For an image that has multiple load regions, the following commands create a file for each load region in the directory root\myprojects\multiload\load_regions:
    cd root\myprojects\multiload
    fromelf --cad image_multiload.axf --output load_regions
    If image_multiload.axf contains the execution regions EXEC_ROM and RAM, then the files EXEC_ROM and RAM are created in the load_regions subdirectory.
Non-ConfidentialPDF file icon PDF versionARM DUI0459G
Copyright © 2008, 2011, 2012, 2014-2016 ARM. All rights reserved. 
  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.