mirror of
https://github.com/openocd-org/openocd.git
synced 2025-10-14 02:58:23 +08:00
flash/nor/rp2040: Fix incorrect erase bounds calculation
when erase region does not start at 0 Signed-off-by: Tomas Vanek <vanekt@fbl.cz> Signed-off-by: Luke Wren <luke@raspberrypi.com> Change-Id: I2b9db61e8ac837b6c6431aacf3b73ed3a1772fbc Reviewed-on: https://review.openocd.org/c/openocd/+/8445 Tested-by: jenkins Reviewed-by: Jonathan Bell <jonathan@raspberrypi.com>
This commit is contained in:
@@ -821,7 +821,7 @@ static int rp2040_flash_erase(struct flash_bank *bank, unsigned int first, unsig
|
||||
goto cleanup_and_return;
|
||||
|
||||
uint32_t offset_next = bank->sectors[first].offset;
|
||||
uint32_t offset_last = bank->sectors[last].offset + bank->sectors[last].size - bank->sectors[first].offset;
|
||||
uint32_t offset_last = bank->sectors[last].offset + bank->sectors[last].size;
|
||||
|
||||
/* Break erase into multiple calls to avoid timeout on large erase. Choose 128k chunk which has
|
||||
fairly low ROM call overhead and empirically seems to avoid the default keep_alive() limit
|
||||
|
Reference in New Issue
Block a user