13.12.5 CRC Calculation
When the module is enabled (upon POR), the device will scan the regions selected (as
defined in 13.12.3 Memory Selection) and
run respective CRCs for them, using the 32-bit CRC module. For the boot section, the CRC
polynomial (CRCXOR) is determined by the BCRCPOL value in configuration memory, the seed
value (CRCOUT) is determined by the BCRCSEED value in configuration memory, the CRC
Accumulator mode is configured to augment the data with zeroes (ACCM = 1
) and the data are read in 16-bit segments (CRCCON2 =
0x0F
). The resulting check value is compared to the BCRCERES value
in configuration memory.
For the non-boot sections (application, SAF, configuration and data EEPROM), all
selected sections are scanned and calculated together using the polynomial from the
CRCPOL value in configuration memory, the seed from the CRCSEED value in configuration
memory and is compared against the CRCERES value in configuration memory. Like the boot
section, the CRC for non-boot sections is configured to augment the data with zeroes
(ACCM = 1
). For the application and SAF sections, the data
are read in 16-bit segments (CRCCON2 = 0x0F
), while for the configuration
and data EEPROM sections, the data are read in 8-bit segments (CRCCON2 =
0x07
).