str9x.c: remove optimization when erasing the whole bank
authorLaurentiu Cocanu <laurentiu.cocanu@zylin.com>
Thu, 14 Jan 2010 12:59:36 +0000 (13:59 +0100)
committerØyvind Harboe <oyvind.harboe@zylin.com>
Thu, 14 Jan 2010 14:07:24 +0000 (15:07 +0100)
Using the erase bank command will cause a time out error. Replacing
this with the erase sector bank will provide a slower but safer and
stable method to erase the flash.

Signed-off-by: Laurentiu Cocanu <laurentiu.cocanu@zylin.com>
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
src/flash/nor/str9x.c

index bf3f750f192dc956d9a584005a5bb65ff423ab44..d0c1278f572f9f35d4d9742ac267e75b8c19bed0 100644 (file)
@@ -230,17 +230,9 @@ static int str9x_erase(struct flash_bank *bank, int first, int last)
                return ERROR_TARGET_NOT_HALTED;
        }
 
-       /* Check if we erase whole bank */
-       if ((first == 0) && (last == (bank->num_sectors - 1)))
-       {
-               /* Optimize to run erase bank command instead of sector */
-               erase_cmd = 0x80;
-       }
-       else
-       {
-               /* Erase sector command */
-               erase_cmd = 0x20;
-       }
+       /*A slower but stable way of erasing*/
+       /* Erase sector command */
+       erase_cmd = 0x20;
 
        for (i = first; i <= last; i++)
        {
@@ -296,10 +288,6 @@ static int str9x_erase(struct flash_bank *bank, int first, int last)
                        LOG_ERROR("error erasing flash bank, status: 0x%x", status);
                        return ERROR_FLASH_OPERATION_FAILED;
                }
-
-               /* If we ran erase bank command, we are finished */
-               if (erase_cmd == 0x80)
-                       break;
        }
 
        for (i = first; i <= last; i++)

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)