This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

ARM: Embedding CRC word into AXF file

I'm using an STM32 target, and I need to embed a length and CRC word into the generated code in order for my bootloader (which always runs at reset) to run a consistency check on the application before branching to it. The CRC is appended to the end of the generated image to simplify checking i.e. I get a checksum of zero if code is ok.

I found a very useful thread on the forum (http://www.keil.com/forum/10582/) that discusses the use of linker symbols to obtain the image size; I've used this successfully to embed the length at a fixed address near the start of the image (after the vector table).

Generating the CRC is simple by parsing the hex file with a simple utility which is called from the Keil project manager. Unfortunately this means the target can only be programmed using the hex file; the system will fail if the target is programmed from the IDE using the AXF file which is an inconvenience. Is there any way of inserting the required data into the AXF file so a valid image will be loaded when I start debugging? Currently I have set up a separate project to program the target with the hex file and then disabled programming operations in the debugger options in my main project, but this is rather error prone!

0