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.

TMS570LS3137: CRC64 implementation does not match the linker generated when CRC when certain Data are used

Part Number: TMS570LS3137


Hi,

I know that there have been similar threads regarding the CRC implementation and they have been helpful in giving me an idea on how to go about the CRC implementation.

Usecase

So technically what I am trying to do is to make some changes to some calibration values in the calibration area of my executable, and then recalculate the CRC of the full calibration region and replace the original CRC with new CRC so that the image would still be valid as if it was generated by the linker itself. I have implemented a script in MATLAB which extracts the Calibration region of my hex and then generates a CRC64.

Validation

To first validate that my implementation works, I have used online sites with the same algorithm and also used the pycrc tool which was proposed in similar threads and I get exactly the same results for different inputs.

Problem

I have run this script on the original hex file so that I can compare the original CRC generated in the map file to my implementation but this does not give me the same result shown below.

The puzzling thing now is that when I set all the values of the parameters in the CAL region to zeros, a CRC is still generated by the linker as it seems by default, the CAL region contains some values as shown below:

and at this point using my script to extract the default values and running my implementation of the algorithm, I get exactly the same CRC value generated by the linker in the map file.

I have tried changing 1 or 2 values within the region with everything else set to zeros and I can still match the generated CRC, but I cannot tell where/why it falls over with the full data set for my calibration values.

my assumption is that the linker would take all the parameters within this region starting from 0x2c0000 up till 0x2c8f00, 8 bytes at a time, endian 32bit swapped.

_Cal_crc_table @ 002fffe0 records: 1, size/record: 24, table size: 32
.CALMEMORY: algorithm=TMS570_CRC64_ISO(ID=10), load addr=002c0000, size=00008f00, CRC=e94b9294676180be

Does anyone know if there are some alignment requirements or padding requirements I need to be aware of?