15.10. Array Output Format

The --array option causes the output to be generated in C array format. In this format, data contained in initialized sections of an executable file are defined as C arrays. Output arrays may be compiled along with a host program and used to initialize the target at runtime.

Arrays are formed by collecting the initialized sections from the input executable. There are two ways arrays are formed:

  • With the ROMS directive. Each memory range that is given in the ROMS directive denotes an array. The romname is used as the array name. The origin and length parameters of the ROM directive are required. The memwidth, romwidth, and files parameters are invalid and are ignored.

  • No ROMS directive (default). If no ROMS directive is given, arrays are formed by combining initialized sections within each page, beginning with the first initialized section. Arrays will reflect any gaps that exist between sections.

The --array:name_prefix option can be used to override the default prefix for array names. For example, use --array:name_prefix=myarray to cause the prefix of myarray to be used.

The data type for array elements is uint8_t.