Any plans for eraseblock or erasechip in the new hardware.flash object for the imp003?

erasesector is quite slow when we need to do a full chip erase, for instance.

You can’t do erasechip because the imp is using part of the chip to keep a wifi firmware backup.

eraseblock could be added, but would fail on some blocks (eg ones near the start, where erasing a block would impact the imp’s section).

You could also get a faster SPI flash :slight_smile:

eraseblock would be really useful. I would figure the api would treat eraseblock(0) as the first block after the imp’s reserved section. Missing some sectors towards the beginning is a small price to pay, and can always be corrected with a combination eraseblock and erasesector calls. And erasechip could be a wrapper for eraseblock that just uses eraseblock internally to erase all the unreserved space. Is that doable?

Yes, possible (and, at the moment, I believe everything is on 64kB boundaries so a 64kB erase would be ok). Need to check that every chip we support has the same block sizes, though.