This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Hi,
I am trying to verify that I can pre-determine a crc value and that it matches what the crc module generates on the TMS570. Eventually I will be using the crc module in auto mode across all of flash, but as a first step I wanted to see if I could run it in full mode and generate a crc value for one 64 bit chunk of data, and make sure it matches what I calculate. However, the two values do not match. Can someone take a look at my crc set up for full mode and let me know what I may be doing incorrectly? Is my approach valid?
When I calculate the value (using pycrc) I get 0x46A5A9388A5BEFFE. The value I get from the crc module is
0x46C80A306F49FA85. My input data is 123456789
Thanks
uint32 channel = 1; uint64 crcModuleValue = 0; crcConfig_t crcConfig; crcModConfig_t crcData; uint64 data = 123456789; crcData.mode = CRC_FULL_CPU; //< Mode of operation crcData.crc_channel = channel; //< CRC channel-0,1 crcData.src_data_pat = &data; //< Pattern data crcData.data_length = sizeof(data); crcConfig.crc_channel = channel; //< CRC channel-0,1 crcConfig.mode = CRC_FULL_CPU; //< Mode of operation crcConfig.pcount = 1; //< Pattern count crcConfig.scount = 1; //< Sector count crcConfig.wdg_preload = 0; //< Watchdog period crcConfig.block_preload = 0; crcInit(); crcSetConfig(crcREG, &crcConfig); crcSignGen(crcREG, &crcData); crcModuleValue = crcGetPSASig(crcREG, channel);
David,
I haven't yet tried out your code yet but someone else did have a similar issue earlier with CRC values not matching with a precalculated value:
http://e2e.ti.com/support/microcontrollers/hercules/f/312/t/321430.aspx
It appears that swapping the high and low 32-bit words of a uint64 value before writing to the PSA signature register solves the problem. It's a difference in endianness that could be causing the issue.
Do try this out and let me know if it solves the issue.
Thanks and Regards,
Chaitanya