aboutsummaryrefslogtreecommitdiff
path: root/src/flash/nor/dsp5680xx_flash.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/flash/nor/dsp5680xx_flash.c')
-rw-r--r--src/flash/nor/dsp5680xx_flash.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/flash/nor/dsp5680xx_flash.c b/src/flash/nor/dsp5680xx_flash.c
index d804088f..dd32a2fa 100644
--- a/src/flash/nor/dsp5680xx_flash.c
+++ b/src/flash/nor/dsp5680xx_flash.c
@@ -198,6 +198,8 @@ static int dsp5680xx_flash_info(struct flash_bank *bank, char *buf, int buf_size
static int dsp5680xx_flash_erase(struct flash_bank * bank, int first, int last){
int retval;
retval = dsp5680xx_f_erase(bank->target, (uint32_t) first, (uint32_t) last);
+if ((!(first|last)) || ((first == 0) && (last == (HFM_SECTOR_COUNT-1))))
+ last = HFM_SECTOR_COUNT-1;
if(retval == ERROR_OK)
for(int i = first;i<=last;i++)
bank->sectors[i].is_erased = 1;