SPRU513Z August 2001 – October 2023 SM320F28335-EP
C2000 is a 16-bit word addressable target, which means that its char data type is 16 bits. However, CRC algorithms operate on 8-bit units, which we shall call "octets". When computing a CRC on a C2000 section, the data cannot be fed to the CRC loop char-by-char, it must be fed octet-by-octet. The only algorithm that breaks this convention is the C28_CHECKSUM_16 algorithm, which reads in 16-bit words to perform the checksum. This is done to match CCS’s checksum utility.
The data needs to be fed to the CRC in the order it would if the C2000 were a 8-bit machine, so we need to consider which of the two octets in the char to feed first. C2000 is a little-endian machine, but it does not make sense to talk about the endianness of the bits in an indivisible unit such as char. By convention, we consider the data in a char to be stored least-significant octet first, then most-significant octet.
Abstractly, the CRC algorithm computes the CRC bit-by-bit in the order the bits appear in the data. For a machine with 8-bit chars, this order is considered to proceed from the MSB through the LSB of each byte starting with byte 0. However, for C2000, the CRC starts with the MSB through LSB of the LEAST significant octet of byte 0, then the MSB through LSB of the MOST significant octet of byte 0, and so on for the rest of the bytes.