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
Hi Xaro,
Don't know how you configure the CRC module.
Have you try to refer the crc example in SDK_2.2_TWR-K60D100M(C:\SDK_2.2_TWR-K60D100M\boards\twrk60d100m\driver_examples\crc)?
I can only get the result 0xED82CD11 by using online CRC calculation.
I can also get the same result from K60 running crc example in SDK_2.2_TWR-K60D100M.
Best Regards,
Robin
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
wordwise calculation
If you debug that example, you can see the value write into CRC_DATA is 0x64636261
bytewise calculation:
base->ACCESS8BIT.DATALL = *data;
input a(0x61)
input b(0x62)
input c(0x63)
input d(0x64)
Best Regards,
Robin
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------