6.19.3 CRC Calculation Procedure
The software procedure for calculating CRC for a set of data that is stored in Cortex-M3 addressable memory space is as follows:
- Save the current value of the µCRC Result Register (µCRCRES) into the stack to allow calculation of CRC in nested interrupt
- Clear the µCRC Result Register (µCRCRES) by setting the CLEAR field of the µCRC Control Register (µCRCCONTROL) to "1"
- Configure the µCRC polynomials (CRC8, CRC16-P1, CRC16-P2, or CRC32) in the µCRC Configuration Register (µCRCCONFIG)
- Read the data from memory locations for which CRC needs to be calculated using mirrored address
- Read the µCRCRES register to get the calculated CRC value. Pop the last saved value of the CRC from the stack and store this value into the µCRC Result Register (uCRCRES)