> On May 15, 2017, at 3:46 PM, Christopher Collins <ch...@runtime.io> wrote: > > Hi Jacob, > > On Mon, May 15, 2017 at 02:51:35PM -0700, Jacob Rosenthal wrote: >> So Ill duplicate the upload command to an erase command. >> >> Is there a bit of metadata I could check to see if a slot was filled and >> erase was necessary? If so I could conditionally erase in the upload >> command still, for backwards compat reasons. > > No, I'm afraid there is no way to distinguish an empty slot from a > partially written one. We would need to add a new newtmgr command for > that (or add an option to "image list"). > > Just to be clear, there also isn't an erase command at the moment. This > still needs to be added. >
Maybe we could add hw/hal/src/hal_flash.c:hal_flash_erase_if_needed()? Which would erase slots which have any non-0xff bytes, and then use it from image erase.