flash: add error messages upon incorrect arguments to flash iteration
authorØyvind Harboe <oyvind.harboe@zylin.com>
Tue, 19 Jan 2010 08:47:21 +0000 (09:47 +0100)
committerØyvind Harboe <oyvind.harboe@zylin.com>
Tue, 19 Jan 2010 09:58:48 +0000 (10:58 +0100)
According to OpenOCD error handling rules the error is
logged at where it occurs(same site where an exception
would have been thrown).

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
src/flash/nor/core.c

index aedaa8661c66ecfa69e4f4dcb69f9e254a63c9a3..277da38c9fdd9ebcc6cb58ff7231ec988e844f18 100644 (file)
@@ -324,14 +324,20 @@ static int flash_iterate_address_range(struct target *target,
        {
                /* special case, erase whole bank when length is zero */
                if (addr != c->base)
+               {
+                       LOG_ERROR("Whole bank access must start at beginning of bank.");
                        return ERROR_FLASH_DST_BREAKS_ALIGNMENT;
+               }
 
                return callback(c, 0, c->num_sectors - 1);
        }
 
        /* check whether it all fits in this bank */
        if (addr + length - 1 > c->base + c->size - 1)
+       {
+               LOG_ERROR("Flash access does not fit into bank.");
                return ERROR_FLASH_DST_BREAKS_ALIGNMENT;
+       }
 
        /** @todo: handle erasures that cross into adjacent banks */
 

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)