Hello,
I am aware of tools like SRecord but they don't solve the problem of image checksum verification (image programmed by ULINK) during start-up, because they cannot patch an .axf file correctly (AFAIK) - thus boot will fail due to checksum verification failure (if programming via ULINK). Can any component of the tool chain generate a checksum that is added at the very end of an image so that a verification will work whether the image was programmed via ULINK or a bootloader?
Thanks in advance
I did find this thread:
http://www.keil.com/forum/17939/
I can reserve 2 or 4 bytes in the image for CRC to be inserted later. Need a PC tool for that that will be triggered at the end of the build - can write my own.
"I can reserve 2 or 4 bytes in the image for CRC to be inserted later. Need a PC tool for that that will be triggered at the end of the build - can write my own."
That's exactly what I've done. A little application (in C) that is executed as part of the build process. It reads in the file from the linker, appends a 4 byte CRC, and writes it back.
But, there again, I always use binary images. Never ventured into doing something on ELF files.
I can probably create a "development" vs. "release" targets for project components - the "release" does scatter loading that takes into account the last 4 bytes, making it longer to load into the debugger, but normally it would have the watchdog enabled anyway. Thanks.
There's no particularly strong you have to load the code from the actual .axf file and nowhere else.
You must already have a tool that can compute the checksum from the hex file. So you can isolate that checksum into a very small hex file of its own and tell the debugger init script to flash that after the .axf file has been flashed.