diff options
author | Tomas Vanek <vanekt@fbl.cz> | 2017-10-26 18:00:33 +0200 |
---|---|---|
committer | Spencer Oliver <spen@spen-soft.co.uk> | 2017-12-12 21:16:21 +0000 |
commit | 90a6245eecd82c95112c09700cfebcf2403d0478 (patch) | |
tree | 8d39136616a11cb4c8afcaa22d4db2f315275633 /src/flash | |
parent | 04227634896ebe6a600d647508b6c934791662b7 (diff) | |
download | riscv-openocd-90a6245eecd82c95112c09700cfebcf2403d0478.zip riscv-openocd-90a6245eecd82c95112c09700cfebcf2403d0478.tar.gz riscv-openocd-90a6245eecd82c95112c09700cfebcf2403d0478.tar.bz2 |
flash/nor/stm32f2x: fix protection block size for F767 in dual bank mode
A protection block comprises two adjacent sectors in dual bank mode.
As there are 64 and 128kB sectors joined in blocks 2 and 8, block size
should be computed as a sum of sector sizes.
Change-Id: Ie915df8cf7ca232c4565d7e0c514c8933e71fdfe
Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-on: http://openocd.zylin.com/4271
Tested-by: jenkins
Reviewed-by: Andreas Bolsch <hyphen0break@gmail.com>
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
Diffstat (limited to 'src/flash')
-rw-r--r-- | src/flash/nor/stm32f2x.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/flash/nor/stm32f2x.c b/src/flash/nor/stm32f2x.c index 65cb212..8127f13 100644 --- a/src/flash/nor/stm32f2x.c +++ b/src/flash/nor/stm32f2x.c @@ -1047,7 +1047,8 @@ static int stm32x_probe(struct flash_bank *bank) if (device_id == 0x451) { for (i = 0; i < num_prot_blocks; i++) { bank->prot_blocks[i].offset = bank->sectors[i << 1].offset; - bank->prot_blocks[i].size = bank->sectors[i << 1].size << 1; + bank->prot_blocks[i].size = bank->sectors[i << 1].size + + bank->sectors[(i << 1) + 1].size; } } } else { |