View Single Post
Old 06-24-2016, 08:39 AM   #73
knc1
Going Viral
knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.
 
knc1's Avatar
 
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
Quote:
Originally Posted by geekmaster View Post
The previous version sometimes copied too little data, which was worse. I will fix that, if I can figure out where to chop it, and I will add the cpio extraction seaniko7 posted to my thread too, I think. I need to track down this "mkimage" of which you speak, to test my changes...
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.
knc1 is offline   Reply With Quote