Hello,
We are trying to calculate the FLASH checksum with the crc_table() operator in the linker cmd file of TMS320F2811 device. We are able to get the CRC value in the table at the specified memory location.
FlashASections
{
/* Allocate program areas: */
*(.cinit)
//*(.pinit)
/* Initalized sections go in Flash */
/* For SDFlash to program these, they must be allocated to page 0 */
*(.econst)
*(.switch)
} crc_table(_crc32Value, algorithm=CRC32_PRIME) > FLASHA, PAGE = 0
Based on the above information, we wanted to write a verification logic to verify this checksum in the code during application startup. We have tried using CRC32 algorithm implementation in our C code, but we are unable to get the same value. We tried bit reversing, initial value set to 0x00000000 as well as set to 0xFFFFFFFF, still it does not return the same value. We are using the flash start location and size from the one calculated by the crc_table operator. In our verification logic we are using an array size of 256 CRC32 look up table.
We are trying to see if there is any particular algorithm that needs to be used to get the same CRC as calculated by the crc_table() operator?
The other question we have is since this family of Microcontrollers have 16 bits to denote a byte. For calculating CRC, should we consider 16 bits as 1 byte to calculate or take LSB and MSB separately and then calculate CRC.
We are also trying to use the same logic for MSP430F2272 board, is there any specific changes required for that or we can use the same logic for that also.
Please suggest what could be the best way to compare and verify the crc_table calculation.
Thanks in Advance,
Aviinaash S