]> git.sur5r.net Git - openocd/blobdiff - src/flash/nor/stm32l4x.c
flash/nor/stm32: Report errors in wait_status_busy
[openocd] / src / flash / nor / stm32l4x.c
index e47313c199262839077e69bf19970393d738e942..f71369330eb451d6b5a5788d831e88a7e06c6e0a 100644 (file)
@@ -187,6 +187,8 @@ static int stm32l4_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
                 */