This is an automated email from Gerrit.

"Tomas Vanek <van...@fbl.cz>" just uploaded a new patch set to Gerrit, which 
you can find at https://review.openocd.org/c/openocd/+/8445

-- gerrit

commit dee482b9a14e6e10bf5fa9f5d45a84bc58318ce1
Author: Luke Wren <l...@raspberrypi.com>
Date:   Tue Aug 6 11:57:04 2024 +0100

    flash/nor/rp2040: Fix incorrect erase bounds calculation
    
    when erase region does not start at 0
    
    Signed-off-by: Tomas Vanek <van...@fbl.cz>
    Change-Id: I2b9db61e8ac837b6c6431aacf3b73ed3a1772fbc

diff --git a/src/flash/nor/rp2040.c b/src/flash/nor/rp2040.c
index 78064ced2a..ec4d0a0454 100644
--- a/src/flash/nor/rp2040.c
+++ b/src/flash/nor/rp2040.c
@@ -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

-- 

Reply via email to