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>
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