summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorØyvind Harboe <oyvind.harboe@zylin.com>2010-11-08 16:53:24 +0100
committerØyvind Harboe <oyvind.harboe@zylin.com>2010-11-09 08:12:51 +0100
commitfc4e001de34029ca6451038a351b433677d4f388 (patch)
treeb81b76346afec839e3de30463e165bfcbdb565e1 /src
parent6ef3d4ccfe2ac017c26072101059628baf99f318 (diff)
downloadopenocd+libswd-fc4e001de34029ca6451038a351b433677d4f388.tar.gz
openocd+libswd-fc4e001de34029ca6451038a351b433677d4f388.tar.bz2
openocd+libswd-fc4e001de34029ca6451038a351b433677d4f388.tar.xz
openocd+libswd-fc4e001de34029ca6451038a351b433677d4f388.zip
stm32: return early upon block write failure
only if we do not have enough ram do we continue. Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
Diffstat (limited to 'src')
-rw-r--r--src/flash/nor/stm32x.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/flash/nor/stm32x.c b/src/flash/nor/stm32x.c
index 63a137c1..6b46afc8 100644
--- a/src/flash/nor/stm32x.c
+++ b/src/flash/nor/stm32x.c
@@ -668,6 +668,9 @@ static int stm32x_write(struct flash_bank *bank, uint8_t *buffer,
}
}
+ if ((retval != ERROR_OK) && (retval != ERROR_TARGET_RESOURCE_NOT_AVAILABLE))
+ return retval;
+
while (words_remaining > 0)
{
uint16_t value;