risc-v/bl602:fix bl602_flash_erase to erase the wrong block

This commit is contained in:
Virus.V 2021-03-09 23:06:34 +08:00 committed by Brennan Ashton
parent 330eff36d7
commit c34667b450

View File

@ -73,7 +73,7 @@ int bl602_flash_erase(uint32_t addr, int len)
flags = up_irq_save();
((bl602_romdrv_erase_fn)(*((uint32_t *)(ROMAPI_SFLASH_EREASE_NEEDLOCK))))
(g_bl602_romflash_cfg.cfg, addr, addr + len);
(g_bl602_romflash_cfg.cfg, addr, addr + len - 1);
up_irq_restore(flags);
return 0;