View Single Post
Old 06-24-2016, 08:59 AM   #75
geekmaster
Carpe diem, c'est la vie.
geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.
 
geekmaster's Avatar
 
Posts: 6,433
Karma: 10773670
Join Date: Nov 2011
Location: Multiverse 6627A
Device: K1 to PW3
Quote:
Originally Posted by knc1 View Post
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.
geekmaster is offline   Reply With Quote