Hello,
I want to calculate the .text section's CRC and for that I added the following code to my linker
palign=8, crc_table(g_linker_sourceCrc, algorithm=TMS570_CRC64_ISO)> FLASH0 | FLASH1
and my main.c contains the variable (extern const CRC_TABLE g_linker_sourceCrc;)
After that I get the data I need from the g_linker_sourceCrc constant.
uint8_t *pCrc = (uint32_t)g_linker_sourceCrc.recs[0].addr; uint64_t crc = g_linker_sourceCrc.recs[0].crc_value; uint32_t size = g_linker_sourceCrc.recs[0].size/8;
And finally I initiate the CRC module and feed data to it.
CRCReg->CRC_CTRL0 |= 0x00000001; // reset CRC module CRCReg->CRC_CTRL0 &= 0xFFFFFFFE; CRCReg->CRC_CTRL2 |= 0x00000003; // configure full CPU mode for(i = 0; i < size; i++) { CRCReg->PSA_SIGREGL1 = *pCrc++; }
This should calculate a CRC that matches the one generated by the linker (true or not?), but I get very different CRCs. What could be the problem?