2016-03-14 10:01 AM
I'm using the CRC unit on the STM32L486. In the reference manual it states that:
''CRC computation is done on the whole 32-bit dataword or byte by byte depending on the format of the data being written.''However, later in the documentation it states that:''The data size can be dynamically adjusted to minimize the number of write accesses for a given number of bytes. For instance, a CRC for 5 bytes can be computed with a word write followed by a byte write.''From my use of the CRC unit, it seems that I can only achieve the latter statement, which does a byte by byte calculation. Even if I write a whole word to the Data Register (DR), it will process the word a byte at a time.From the first statement, it appears that the CRC should also do word-wise calculations, but I have not been able to accomplish that. Can I do word-wise calculations with this CRC or only byte-wise?Any guidance or clarification on the capabilities of this MCU's CRC peripheral would be greatly appreciated! #crc #stm32 #stm32l4 #bit-cloudy2016-03-14 05:48 PM
Thanks, clive1! That is helpful information. I should be able to run with this.
2016-03-15 10:37 AM
Sticking 0x00001021 into the ''bytes'' window is the equivalent to0x00 0x00 0x00 0x10 0x21
FFFFFFFF
00->4E08BFB4
00->00B7647D
00->B7647D00
10->8B15060B
21->CBA38BD8
Sticking00001021into the ''bytes'' window is the equivalent to0x00 0x00 0x10 0x21
FFFFFFFF
00->4E08BFB4
00->00B7647D
10->FB75A670
21->4BB7ED3F
2016-03-15 10:42 AM
Hi clive1,
Your software calculations were very helpful in verifying the hardware. I am now trying to find a way to adjust the CRC hardware settings so that it can produce standard CRC-32 Castagnoli calculations. I saw your hardware implementation for CRC-32PK, can you help me with CRC-32 Castagnoli?Thanks!2016-03-15 12:22 PM
FYI, to anyone who may be interested, I found that the necessary CRC hardware settings to emulate CRC32-Castagnoli are the following:
Polynomial Coeff:0x1edc6f41
Reverse input data by byteReverse output dataInitial Value: 0xFFFFFFFFThen apply a final XOR of 0xFFFFFFFF to get the final CRC value.