Rick Altherr <kc8apf@kc8apf.net> - fix flash write_bank output.
[openocd.git] / src / flash / flash.c
index fb9fa698b0b72d25015e86b2139e42777b57f8c9..6d47334b9302158f78c3689e112716149662871d 100644 (file)
@@ -792,20 +792,16 @@ int handle_flash_fill_command(struct command_context_s *cmd_ctx, char *cmd, char
        for (wrote=0; wrote<(count*wordsize); wrote+=sizeof(chunk))
        {
                int cur_size = MIN( (count*wordsize - wrote) , 1024 );
-               if (err == ERROR_OK)
+               flash_bank_t *bank;
+               bank = get_flash_bank_by_addr(target, address);
+               if(bank == NULL)
                {
-                       flash_bank_t *bank;
-                       bank = get_flash_bank_by_addr(target, address);
-                       if(bank == NULL)
-                       {
-                               err = ERROR_FAIL;
-                               break;
-                       }
-                       err = flash_driver_write(bank, chunk, address - bank->base + wrote, cur_size);
-                       wrote += cur_size;
+                       return ERROR_FAIL;
                }
+               err = flash_driver_write(bank, chunk, address - bank->base + wrote, cur_size);
                if (err!=ERROR_OK)
-                       break;
+                       return err;
+               wrote += cur_size;
        }
 
        if ((retval = duration_stop_measure(&duration, &duration_text)) != ERROR_OK)
@@ -879,7 +875,7 @@ int handle_flash_write_bank_command(struct command_context_s *cmd_ctx, char *cmd
                fileio_close(&fileio);
                return retvaltemp;
        }
-       if (retval!=ERROR_OK)
+       if (retval==ERROR_OK)
        {
        command_print(cmd_ctx, "wrote  %"PRIi64" byte from file %s to flash bank %i at offset 0x%8.8x in %s (%f kb/s)",
                fileio.size, args[1], strtoul(args[0], NULL, 0), offset, duration_text,

Linking to existing account procedure

If you already have an account and want to add another login method you MUST first sign in with your existing account and then change URL to read https://review.openocd.org/login/?link to get to this page again but this time it'll work for linking. Thank you.

SSH host keys fingerprints

1024 SHA256:YKx8b7u5ZWdcbp7/4AeXNaqElP49m6QrwfXaqQGJAOk gerrit-code-review@openocd.zylin.com (DSA)
384 SHA256:jHIbSQa4REvwCFG4cq5LBlBLxmxSqelQPem/EXIrxjk gerrit-code-review@openocd.org (ECDSA)
521 SHA256:UAOPYkU9Fjtcao0Ul/Rrlnj/OsQvt+pgdYSZ4jOYdgs gerrit-code-review@openocd.org (ECDSA)
256 SHA256:A13M5QlnozFOvTllybRZH6vm7iSt0XLxbA48yfc2yfY gerrit-code-review@openocd.org (ECDSA)
256 SHA256:spYMBqEYoAOtK7yZBrcwE8ZpYt6b68Cfh9yEVetvbXg gerrit-code-review@openocd.org (ED25519)
+--[ED25519 256]--+
|=..              |
|+o..   .         |
|*.o   . .        |
|+B . . .         |
|Bo. = o S        |
|Oo.+ + =         |
|oB=.* = . o      |
| =+=.+   + E     |
|. .=o   . o      |
+----[SHA256]-----+
2048 SHA256:0Onrb7/PHjpo6iVZ7xQX2riKN83FJ3KGU0TvI0TaFG4 gerrit-code-review@openocd.zylin.com (RSA)