From: Øyvind Harboe Date: Mon, 8 Nov 2010 15:53:24 +0000 (+0100) Subject: stm32: return early upon block write failure X-Git-Tag: v0.5.0-rc1~352 X-Git-Url: https://review.openocd.org/gitweb?p=openocd.git;a=commitdiff_plain;h=fc4e001de34029ca6451038a351b433677d4f388;hp=6ef3d4ccfe2ac017c26072101059628baf99f318 stm32: return early upon block write failure only if we do not have enough ram do we continue. Signed-off-by: Øyvind Harboe --- diff --git a/src/flash/nor/stm32x.c b/src/flash/nor/stm32x.c index 63a137c196..6b46afc8d5 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;