Overview

A Cyclic Redundancy Check (CRC) takes a data stream of bytes from the NVM (either entire Flash, only Boot section, or both application code and Boot section) and generates a checksum. The CRC peripheral (CRCSCAN) can be used to detect errors in program memory.

The last location in the section to check has to contain the correct pre-calculated checksum for comparison. If the checksum calculated by the CRCSCAN and the pre-calculated checksums match, a Status bit in the CRCSCAN is set. If they do not match, the Status register will indicate that it failed. The user can choose to let the CRCSCAN generate a Non-Maskable Interrupt (NMI) if the checksums do not match.

An n-bit CRC, applied to a data block of arbitrary length, will detect any single alteration (error burst) up to n bits in length. For longer error bursts, a fraction 1-2-n will be detected.

The CRC-generator supports CRC-16-CCITT.

Polynomial:

The CRC reads in byte-by-byte of the content of the section(s) it is set up to check, starting with byte 0, and generates a new checksum per byte. The byte is sent through an implementation corresponding to Figure 1, starting with the Most Significant bit. If the last two bytes in the section contain the correct checksum, the CRC will pass. See Checksum for how to place the checksum. The initial value of the Checksum register is 0xFFFF.

Figure 1. CRC Implementation Description