def _chip_erase_program(self, progress_cb=_stub_progress):
        logging.debug("Smart chip erase")
        logging.debug("%i of %i pages already erased", len(self.page_list) - self.chip_erase_count, len(self.page_list))
        progress_cb(0.0)
        progress = 0
        self.flash.eraseAll()
        progress += self.flash.getFlashInfo().erase_weight
        for page in self.page_list:
            if not page.erased:
                self.flash.programPage(page.addr, page.data)
                progress += page.getProgramWeight()
                progress_cb(float(progress) / float(self.chip_erase_weight))
        progress_cb(1.0)
        return FlashBuilder.FLASH_CHIP_ERASE
Program by first performing a chip erase.
dataset/ETHPy150Open mbedmicro/pyOCD/pyOCD/flash/flash_builder.py/FlashBuilder._chip_erase_program