SPRU513Y August 2001 – June 2022 SM320F28335-EP
Along with generating CRC Tables, the linker can also generate CRCs over memory ranges as well. To do this, instead of using the crc_table() operator in a SECTIONS directives, you use the crc() operator in a MEMORY directive. Within the MEMORY directive, you specify a GROUP of memory regions to have a CRC value computed. The memory ranges in the GROUP must be continuous.
The syntax is as follows:
MEMORY
{
GROUP(FLASH)
{
RANGE1 :...
RANGE2 :...
} crc(_table_name, algorithm=xxx)
}
This syntax causes the linker to
compute a single CRC over both RANGE1 and RANGE2. The CRC is based on the algorithm
specified, taking into account all output sections that have been placed in those
ranges. The result is stored in a table in the format described in Section 9.10.2.6. This table is
placed in an output section called .TI.memcrc
, which is accessible
through the table name as a linker symbol.
The algorithm argument for crc() may be any algorithm listed in Section 9.10.1.1. The algorithm is required in the current version, and linking will fail without it. In future releases, the algorithm specification will be optional, and the default is specified If no algorithm is specified, the default algorithm will be chosen, which is CRC32_PRIME.
Specifying the GROUP name is optional. For example:
MEMORY
{
GROUP
{
RANGE1 :...
RANGE2 :...
} crc(_table_name, algorithm=CRC8_PRIME)
}
When GROUP is used inside a MEMORY block, the syntax options are limited to the functionality described here and in the subsections that follow. The full functionality described in Section 9.6.7 for GROUP within the SECTIONS directive is not available within the MEMORY directive.