- corrected error with stm32 page calculation
[openocd.git] / src / flash / flash.c
index fda2c91a12e2a025b2a33ced2cbef4a5c47405c2..3b2abe2304cf31f4f45273d34484f7da137fa89b 100644 (file)
@@ -70,6 +70,7 @@ extern flash_driver_t stm32x_flash;
 extern flash_driver_t tms470_flash;
 extern flash_driver_t ecosflash_flash;
 extern flash_driver_t lpc288x_flash;
+extern flash_driver_t ocl_flash;
 
 flash_driver_t *flash_drivers[] =
 {
@@ -84,6 +85,7 @@ flash_driver_t *flash_drivers[] =
        &tms470_flash,
        &ecosflash_flash,
        &lpc288x_flash,
+       &ocl_flash,
        NULL,
 };
 
@@ -476,7 +478,7 @@ int handle_flash_erase_address_command(struct command_context_s *cmd_ctx, char *
        p = get_flash_bank_by_addr(target, address);
        if (p == NULL)
        {
-               return ERROR_COMMAND_SYNTAX_ERROR;
+               return ERROR_FAIL;
        }
 
        /* We can't know if we did a resume + halt, in which case we no longer know the erased state */
@@ -827,12 +829,15 @@ int handle_flash_write_bank_command(struct command_context_s *cmd_ctx, char *cmd
        buffer = malloc(fileio.size);
        if (fileio_read(&fileio, fileio.size, buffer, &buf_cnt) != ERROR_OK)
        {
+               free(buffer);
+               fileio_close(&fileio);
                return ERROR_OK;
        }
 
        retval = flash_driver_write(p, buffer, offset, buf_cnt);
 
        free(buffer);
+       buffer = NULL;
 
        duration_stop_measure(&duration, &duration_text);
        if (retval!=ERROR_OK)

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)