AnsweredAssumed Answered

CRC: bytewise vs. wordwise different results

Question asked by Xaro Wubas on May 14, 2018
Latest reply on Jun 14, 2018 by Robin_Shen

Device: K60 (little-endian)

I program in assembly.

 

If I write 4 bytes representing the ASCII string "abcd" as a 32 bit *word* to CRC_CRC, I get a different checksum than when I write 4 single bytes in the order 'a', 'b', 'c', 'd' to CRC_CRC[LL], i.e., 4 separate STRB instructions.

 

Why?

 

results for wordwise calculation:

input: abcd
checksum: 0x79A5961D

 

input: dcba
checksum: 0x1D39469F

 

results for bytewise calculation:

input: abcd
checksum: 0x1D39469F

 

input: dcba
checksum: 0x79A5961D

Outcomes