CRC Checksum Generation
716
SLAU356I – March 2015 – Revised June 2019
Copyright © 2015–2019, Texas Instruments Incorporated
CRC32 Module
15.2.1 CRC Standard and Bit Order
The definitions of the various CRC standards were done in the era of main frame computers. At that time,
Bit 0 was treated as MSB. Now, Bit 0 typically denotes LSB (…as value of Bit N = 2N). In
and
the bit references are used as given in the original standards. The MSP432 MCUs treat Bit 0
as LSB, as is typical in modern CPUs and MCUs.
The fact that Bit 0 is treated as LSB by some and as MSB by others can lead to confusion. The CRC32
module, therefore, provides a bit-reversed register pair for CRC16 and CRC32 operations to support both
conventions.
15.2.2 CRC Implementation
To allow faster processing of the CRC, the linear feedback shift register (LFSR) functionality is
implemented with a set of XOR trees. This implementation shows the identical behavior as the LFSR
approach. After a set of 8, 16, or 32 bits is provided to the CRC32 module by writing to the CRC16DI or
CRC32DI registers, a calculation for the whole set of input bits is performed. Either the CPU or the DMA
can write to the memory mapped data input registers. After the last value is written to CRC16DI or
CRC32DIRB, the signature can be read from the CRC16INIRES or CRC32INIRES_LO and
CRC32INIRES_HI registers after a delay of one clock cycle (required to complete the computation for the
last written value). The CRC16 and CRC32 generators accept byte and 16-bit accesses to the input
registers CRC16DI and CRC32DI.
For bit-reversed conventions, write the data bytes to the CRC16DIRB or CRC32DIRB registers.
Initialization is done by writing to CRC, and CRC engine adds them to the signature. The bits among each
byte are reversed. Data bytes written to CRCDI in 16 bit mode or the data byte in byte mode are not bit
reversed before use by the CRC engine. If the checksum itself (with reversed bit order) is included in the
CRC operation (as data written to CRCDI or CRCDIRB), the result in the CRCINIRES and CRCRESR
registers must be zero.