After doing some research, I am not sure if this approach will be suitable for my needs. My task is to verify, every 24 hours, that our application code in flash memory has not been corrupted. Before the code is burned to flash, I plan to calculate a checksum on the application code, from the .flash file, and have those checksum values be incorporated into the app code after linking. To do this,
1.) I need to have a c file with markers in it. This is the file that I need to be
linked in last so that I know where the end of the app code is in .flash.
2.) I need to have control of the link process to ensure I link this file last
everytime.
This link will then produce a .flash file that contains (first) the app code and (last) the c file with the markers in it. I then have code that takes command line parameters and an S_Record file (.flash). It calculates checksum values from the app code in the .flash file. It looks for these end markers to know where the app code ends. This code then auto-regenerates the c file with the markers in it and adds the checksum values to that file. Then, the c file with the markers and the checksum values needs to be recompiled and linked back with the app code. Now the code has what I need to do a diagnostic on the code in flash. To check the code in flash, I have diagnostic code in the app that accomplishes this using the checksum values.
I do not have any experience with linker scripts and my co-workers do not as well, but I am trying to use this process they developed. They developed this on the Motorola 332 using the MRI compiler/linker, where they had to supply their own makefile. Thus, they could order the link of their objs. Please let me know if using the linker script is useful for this application or not. Thanks.