I am using a C6748 booting out of SPIFLASH, which will have its code field-upgradable. As this creates the possibility of the code becoming corrupted in flash, I would like to store a backup image that can be loaded if the primary image fails CRC. This backup image would provide minimal comms sufficient to recover and re-program a working primary image.
I would like to know if it would be possible to do this using AIS, or if a secondary bootloader should be used instead. My idea for accomplishing this in AIS would be this:
- construct an AIS script that loads a large chunk of data, say ~1MB, into memory, CRCs it, boots it if successful, and loads/boots the backup image if not.
- write the above into flash in the factory
- when doing a field upgrade, overwrite only:
* the 1MB data chunk, padded out with 0x00 or 0xFF
* the expected CRC
* the entry point
The only problem I have with attempting to prototype this so far is that I cannot reverse-engineer the 9 different SECTION LOAD commands in the .bin file that AISGen creates from my .out file; I have identified where in the .out file they came from, but not why some sections were used but others were ignored, etc.
So, my questions are:
- Does this proposed solution seem plausable?
- If so, is there more documentation about how I can construct a monolithic memory image to be loaded into my "data chunk", using the .out file.
- If not, can you recommend a secondary bootloader solution (to be loaded via AIS in the normal fashion) that would satisfy my needs, or do you think it would be simple enough to write a custom one?