What to pad flashable images with?

120 views Asked by At

Dumb question... I'm stitching various parts (kernel, FS, etc.) to create a firmware image that will be flashed on NOR flash. Right now I'm padding the remaining space with zeros. Is there any convention / benefits of using other padding?

1

There are 1 answers

0
Randy Leberknight On

I prefer 0xFF (on those devices where that is the erased state), for a couple of reasons.

  • The write to flash will go faster, since the unused region doesn't have to change.
  • Some devices have a limit on the number of re-flash cycles. I prefer not to write if I don't have to.
  • On many devices, if the area is already erased then you don't have to go through the erase cycle to write new data. This can be handy, especially when what you are writing is data, not code. You are not likely to want to add to the code without re-writing all of it, but you may want to add to parameter data which is stored in flash.