flash: nor: mdr: fix verification problem with 1986VE1T or 1986VE3T 09/3509/3
authorAndrey Skvortsov <andrej.skvortzov@gmail.com>
Wed, 25 May 2016 10:11:18 +0000 (13:11 +0300)
committerPaul Fertser <fercerpav@gmail.com>
Tue, 2 Aug 2016 16:49:18 +0000 (17:49 +0100)
1986VE1T and 1986VE3T have issue with flash acceleration engine described
in their errata (issue 0007).
After programming flash acceleration engine's buffer contains old data,
and therefore first read data are wrong. Because of this verification after
programming fails always. Recommended workaround for the issue is to flush
flash accelerator's buffer. To do so it's necessary to read at least 64
bytes of flash through accelerator.

Reading bytes through JTAG using default_flash_read doesn't help.
It seems that reading should be done by uC itself.

Change-Id: I18ef464a68ad5c5b16d3933f31ca61f8e2e7cca3
Signed-off-by: Andrey Skvortsov <andrej.skvortzov@gmail.com>
Reviewed-on: http://openocd.zylin.com/3509
Tested-by: jenkins
Reviewed-by: Paul Fertser <fercerpav@gmail.com>
src/flash/nor/mdr.c

index 68eaf13760043b4497bce59bc0339210b106e871..374cb6f2972c78ff51312e0ead27d7284e9bbc6a 100644 (file)
@@ -469,6 +469,13 @@ free_buffer:
        if (new_buffer)
                free(new_buffer);
 
+       /* read some bytes bytes to flush buffer in flash accelerator.
+        * See errata for 1986VE1T and 1986VE3. Error 0007 */
+       if ((retval == ERROR_OK) && (!mdr_info->mem_type)) {
+               uint32_t tmp;
+               target_checksum_memory(bank->target, bank->base, 64, &tmp);
+       }
+
        return retval;
 }
 

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)