Tool/software:
Dear support team.
One part of the code I need to write will be considered as critical and cannot be changed later, the other part can change without issue.
To comply with this, I have created a specific area in flash_bank for thie critical code and then, use the linker to calculate the CRC:
.section_safety : {sta_tests.obj(.text),
stl_sp.obj(.text),
stl_cpu_reg.obj(.text),
ref_crc.obj(.text) } crc_table(_my_crc_table_for_safety, algorithm=CRC32_PRIME) >FLASHBANK0_SAFETY, ALIGN(8)
The different .obj are the corresponding file which contains the critical code.
The crc is calculated, the crc check (according to the value saved by the linker) at startup is also OK.
My problem is actually that changing some parts of the code in the non critical part change the value of the CRC.
At the begining I had some function called by the critical code which where in the same flash area than non critical code. So as the adresses affected by the linker were changed in case of code change in the non critical code, this can explain the issue (at this time I can also see that the critical .obj file were changed in case of change in non critical code).
So my first job has been to put all the function which were called by the critical code in the specific flash area or replace the function call by the code of the function. I did'nt change the call to function which were inlined considering that the linker will copy the code in the critical area.
Now all this job is done and I still have a different CRC in case of change in the non critical area.

I compare the .obj files of the critical part and before and after the change in the non critical part, the obj are identical. In the .lst file, I can only see a difference in date/time.
But I can see that during "build project" one of the critical c file is build even if for me there is no visible reason.
Perhaps there is still a function call which call code in the non critical area but checking the difference in the .map file, it does'nt seems.
Is there something wrong in my understanding? The CRC of the critical area should not change if there is no change in this part right?
What can I used to find wich part of the critical code is affected by the non critical (if any)?
Regards.