flash/nor: use target_addr_t for flash bank base
[openocd.git] / src / flash / nor / bluenrg-x.c
index c4a8080476d5d4729a051afb9afb20bc694eb9d7..f1b2062019edf1a550dca1a7a65b160f44e2b2f4 100644 (file)
@@ -274,6 +274,7 @@ static int bluenrgx_write_bytes(struct target *target, uint32_t address_base, ui
                if (pre_bytes) {
                        if (target_read_u32(target, pre_address, &pre_word)) {
                                LOG_ERROR("Memory read failed");
+                               free(new_buffer);
                                return ERROR_FAIL;
                        }
 
@@ -282,6 +283,7 @@ static int bluenrgx_write_bytes(struct target *target, uint32_t address_base, ui
                if (post_bytes) {
                        if (target_read_u32(target, post_address, &post_word)) {
                                LOG_ERROR("Memory read failed");
+                               free(new_buffer);
                                return ERROR_FAIL;
                        }
 
@@ -402,9 +404,9 @@ static int bluenrgx_write(struct flash_bank *bank, const uint8_t *buffer,
                /* Stack pointer for program working area */
                buf_set_u32(reg_params[4].value, 0, 32, write_algorithm_sp->address);
 
-               LOG_DEBUG("source->address = %08" TARGET_PRIxADDR, source->address);
-               LOG_DEBUG("source->address+ source->size = %08" TARGET_PRIxADDR, source->address+source->size);
-               LOG_DEBUG("write_algorithm_sp->address = %08" TARGET_PRIxADDR, write_algorithm_sp->address);
+               LOG_DEBUG("source->address = " TARGET_ADDR_FMT, source->address);
+               LOG_DEBUG("source->address+ source->size = " TARGET_ADDR_FMT, source->address+source->size);
+               LOG_DEBUG("write_algorithm_sp->address = " TARGET_ADDR_FMT, write_algorithm_sp->address);
                LOG_DEBUG("address = %08x", address+pre_size);
                LOG_DEBUG("count = %08x", count);
 
@@ -450,6 +452,9 @@ static int bluenrgx_write(struct flash_bank *bank, const uint8_t *buffer,
                destroy_reg_param(&reg_params[2]);
                destroy_reg_param(&reg_params[3]);
                destroy_reg_param(&reg_params[4]);
+               if (retval != ERROR_OK)
+                       return retval;
+
        }
 
        /* Program chunk at end, not addressable by fast burst write algorithm */

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)