]> git.sur5r.net Git - openocd/blobdiff - src/flash/nor/stm32f2x.c
flash/stm32f2x: add stm32f7 revision Z identification
[openocd] / src / flash / nor / stm32f2x.c
index 8013e58698339e95f70a5d5199c90348b064b9f6..b46fb07869f0fba8610e771bfba4a5774a730fc9 100644 (file)
@@ -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;