Using the ECC Specifier in the Memory Map

To generate ECC, add a separate memory range to your memory map to hold ECC data and to indicate which memory range contains the Flash data that corresponds to this ECC data. If you have multiple memory ranges for Flash data, you should add a separate ECC memory range for each Flash data range.

The definition of an ECC memory range can also provide parameters for how to generate the ECC data.

The memory map for a device supporting Flash ECC may look something like this:

MEMORY { VECTORS : origin=0x00000000 length=0x000020 FLASH0 : origin=0x00000020 length=0x17FFE0 FLASH1 : origin=0x00180000 length=0x180000 STACKS : origin=0x08000000 length=0x000500 RAM : origin=0x08000500 length=0x03FB00 ECC_VEC : origin=0xf0400000 length=0x000004 ECC={ input_range=VECTORS } ECC_FLA0 : origin=0xf0400004 length=0x02FFFC ECC={ input_range=FLASH0 } ECC_FLA1 : origin=0xf0430000 length=0x030000 ECC={ input_range=FLASH1 } }

The specification syntax for ECC memory ranges is as follows:

MEMORY { <memory specifier1> : <memory attributes> [ vfill=<fill value> ] <memory specifier2> : <memory attributes> ECC = { input_range = <memory specifier1> [ algorithm = <algorithm name> ] [ fill = [ true, false ] ] } }

The "ECC" specifier attached to the ECC memory ranges indicates the data memory range that the ECC range covers. The ECC specifier supports the following parameters:

input_range = <range> The data memory range covered by this ECC data range. Required.
algorithm = <ECC alg name> The name of an ECC algorithm defined later in the command file using the ECC directive. Optional if only one algorithm is defined. (See Section 8.5.9.2.)
fill = true | false Whether to generate ECC data for holes in the initialized data of the input range. The default is "true". Using fill=false produces behavior similar to the nowECC tool. The input range can be filled normally or using a virtual fill (see Section 8.5.9.3).