From: Øyvind Harboe Date: Mon, 8 Nov 2010 15:53:24 +0000 (+0100) Subject: stm32: return early upon block write failure X-Git-Url: https://git.gag.com/?a=commitdiff_plain;h=fc4e001de34029ca6451038a351b433677d4f388;p=fw%2Fopenocd 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 63a137c19..6b46afc8d 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;