McMCCRU / SNANDer

SNANDer - Serial Nor/nAND/Eeprom programmeR (based on CH341A)
GNU General Public License v2.0
245 stars 65 forks source link

spi_nand_flash: don't break the loop on erase fail #13

Closed Leo-PL closed 3 years ago

Leo-PL commented 3 years ago

NAND flash memories are allowed to contain some bad blocks, which fail to write or fail to erase. Currently, chip erase operation breaks on first failed block, leaving the rest of memory untouched. So, to do full chip erase with failed blocks, manual fiddling with addresses is needed.

To avoid that, don't break the loop on erase fail, but keep the final error status.

McMCCRU commented 3 years ago

Hi! In principle, it is logical to continue erasing process if a bad block is caught. I accept your fix.