Other Parts Discussed in Thread: HALCOGEN,
Hello all,
I am using the linker generated CRC-table feature to compute the CRCs for multiple sections during link time and verify the contents during boot time.
My goal is to have the application installed twice in the flash memory and do the verification of each application in the bootloader.
Currently I use CCS to build and program it to different memory locations (e.g. FLASH_APP_0_PARTITION and FLASH_APP_1_PARTITION). That works fine and also the verification of the code works as expected.
However, when linking the application to different memory locations I noticed that the CRCs that were computed by the linker are not always the same. From my point of view, the CRC of a section should always be the same, no matter where it is located in the memory.
What I tried to find out what is going on:
- Put a random function into its own section and compute the CRC for that section.
Result: When linking it to different locations, the CRC is always the same, no matter where it is located. - I assumed that it might be a padding-issue, so I put each section into a group and added some padding-bytes at the end:
GROUP
{
.text : {} align(8), crc_table(_my_crc_table, algorithm=TMS570_CRC64_ISO)
.dummy : {.+=7;} fill=0x00000000
} > FLASH_APP_0_PARTITION
Result: Still the same. The computed CRCs of the section .text differ depending on the location of FLASH_APP_0_PARTITION
From my understanding, the code of a section is always the same, no matter where it is located. Additionally I would assume that the CRC of that section doesn't change depending on the location, but obviously it does.
Can someone explain why I see that behavior?
Thank you for your help,
Simon