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;