Quote:
Originally Posted by knc1
Start at the tail and read toward the head of the file.
Erased flash (I.E: un-programmed locations in the erase block) are "FF" (all ones - not all zeros).
When you hit the first non-FF byte - call that end of file and throw everything skipped away.
Expect that prior (last of the FF sequence) to be on a 4-byte boundary).
The trimmed file will pass the mkimage internal checksum tests when everything works out as intended.
|
Is that how mkinage does it? If not, then a file that ended with FF could screw the checksum after it is flashed. In which case the "right thing to do" after stripping trailing FFs would be to test checksum and append FFs until it passes, I suppose.