X-Git-Url: https://review.openocd.org/gitweb?p=openocd.git;a=blobdiff_plain;f=src%2Fflash%2Fnor%2Fstm32f2x.c;h=b46fb07869f0fba8610e771bfba4a5774a730fc9;hp=8013e58698339e95f70a5d5199c90348b064b9f6;hb=23cd59cdf2a563b840e5917e36c4241ee4d988f4;hpb=b941e2e727387c6c8880990b829a48b289dfc90b diff --git a/src/flash/nor/stm32f2x.c b/src/flash/nor/stm32f2x.c index 8013e58698..b46fb07869 100644 --- a/src/flash/nor/stm32f2x.c +++ b/src/flash/nor/stm32f2x.c @@ -252,6 +252,8 @@ static int stm32x_wait_status_busy(struct flash_bank *bank, int timeout) /* Clear but report errors */ if (status & FLASH_ERROR) { + if (retval == ERROR_OK) + retval = ERROR_FAIL; /* If this operation fails, we ignore it and report the original * retval */ @@ -597,8 +599,10 @@ static int stm32x_write_block(struct flash_bank *bank, const uint8_t *buffer, retval = target_write_buffer(target, write_algorithm->address, sizeof(stm32x_flash_write_code), stm32x_flash_write_code); - if (retval != ERROR_OK) + if (retval != ERROR_OK) { + target_free_working_area(target, write_algorithm); return retval; + } /* memory buffer */ while (target_alloc_working_area_try(target, buffer_size, &source) != ERROR_OK) { @@ -1186,6 +1190,9 @@ static int get_stm32x_info(struct flash_bank *bank, char *buf, int buf_size) case 0x1000: rev_str = "A"; break; + case 0x1001: + rev_str = "Z"; + break; } break;