diff options
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 |
commit | fc4e001de34029ca6451038a351b433677d4f388 (patch) | |
tree | b81b76346afec839e3de30463e165bfcbdb565e1 | |
parent | 6ef3d4ccfe2ac017c26072101059628baf99f318 (diff) | |
download | openocd+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>
-rw-r--r-- | src/flash/nor/stm32x.c | 3 |
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; |