SPRU513Z August 2001 – October 2023 SM320F28335-EP
If you are trying to generate a CRC value for the entire FLASH memory, place the table in a separate memory range, which .TI.memcrc will be placed in by default. For example:
MEMORY
{
/* Carve out a section of FLASH to store the CRC result */
CRC_PRELUDE : origin=0x0, length=0x10
GROUP
{
FLASH : origin=0x10, length=0xFFFF
} crc(_flash_crc, algorithm=CRC8_PRIME)
/* Other memory ranges... */
}
SECTION
{
.TI.memcrc > CRC_PRELUDE
}
In the above example, a small section of flash has been cut out of the whole, to allow the .TI.memcrc section to reside there, while everything else that is eligible for CRC generation is placed in FLASH. This avoids placing the CRC result in the CRC range.
In some cases, you may want to generate a CRC for all of Flash memory and read back the CRC result via the linker-generated map file (see Section 8.4.19). However, there is no memory location to place the CRC result for the memory range covering all of Flash memory. If you place it in Flash, then you violate the rule that the result cannot be placed within the input range. Thus, if there’s no good place to put the CRC result, you can mark the .TI.memcrc section as a COPY section like so:
.TI.memcrc : type=COPY
This prevents the CRC result for a memory range from being placed anywhere. Marking .TI.memcrc as a DSECT section has the same result.