Only report non-erased or unknown sectors or if bank is fully erased.
Change-Id: I94f0bc2a0d6529d1ea5f66b284cefd6a2c61fe39
Signed-off-by: Uwe Bonnes <bon@elektron.ikp.physik.tu-darmstadt.de>
Reviewed-on: http://openocd.zylin.com/3501
Tested-by: jenkins
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Reviewed-by: Andreas Färber <afaerber@suse.de>
COMMAND_HANDLER(handle_flash_erase_check_command)
{
+ bool blank = true;
if (CMD_ARGC != 1)
return ERROR_COMMAND_SYNTAX_ERROR;
if (p->sectors[j].is_erased == 0)
erase_state = "not erased";
else if (p->sectors[j].is_erased == 1)
- erase_state = "erased";
+ continue;
else
erase_state = "erase state unknown";
+ blank = false;
command_print(CMD_CTX,
"\t#%3i: 0x%8.8" PRIx32 " (0x%" PRIx32 " %" PRIi32 "kB) %s",
j,
erase_state);
}
+ if (blank)
+ command_print(CMD_CTX, "\tBank is erased");
return retval;
}