I would like to implement a checksum into my firmware to verify the integrity of code prior to executing my main application, either using a simply byte sum or CRC checksum. Are there any tools available to calculate this checksum and inject it into a set location into Flash, after the applications has been compiled?
I would like to use this with Code Composer and the LM4F232H5QC.
I see from a post in the Code-Gen Tools forum that CGT can calculate CRC's across a single section. That post was with regard to another processor but I'm guessing there is symmetry across CPU's (I apologize I don't have my tools available at the moment) but I'm not 100% positive.
If the CRC over a single section is inadequate then it should be easy enough to reserve 4 bytes via your linker script and write a quick utility to calculate a CRC on your binary output.
I will require the entire Flash to have a checksum. I can ask our PC software guys to write me an app to do this.
It would be a nice feature to add to CCS, I know IAR has one - it was a little tricky to setup and doesn't work well with software breakpoints, but once it's done its very handy.
just to pick up on the post from you (11Mar12 4:53PM) - what you suggest in your second paragraph is exactly what I am trying to do:
1. Reserve 4 bytes at the beginning of my code image preferably immediately following the intvect section.
2. Use an external tool to calculate the CRC of the image (again, not including the intvects) and store it in the area that I reserved in (1).
I have noticed however, that reserving the 4 dummy bytes using my linker script is trickier than I thought (compiler always wants to take it out because the four bytes aren't actually used in the code...
I have looked through the TI documentation and web sites but I cannot find a good way to do this. Could you help?
Connecting this thread to another related one.
All content and materials on this site are provided "as is". TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with regard to these materials, including but not limited to all implied warranties and conditions of merchantability, fitness for a particular purpose, title and non-infringement of any third party intellectual property right. TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with respect to these materials. No license, either express or implied, by estoppel or otherwise, is granted by TI. Use of the information on this site may require a license from a third party, or a license from TI.
TI is a global semiconductor design and manufacturing company. Innovate with 100,000+ analog ICs andembedded processors, along with software, tools and the industry’s largest sales/support staff.