diff options
author | Andrey Skvortsov <andrej.skvortzov@gmail.com> | 2016-05-25 13:11:18 +0300 |
---|---|---|
committer | Paul Fertser <fercerpav@gmail.com> | 2016-08-02 17:49:18 +0100 |
commit | 5d5c9bc4ecbc8c601e77c95b40fa09ec48a79aea (patch) | |
tree | 5a0b68d9bbdda5065b9e3778752caff3b1361b5a /src | |
parent | f19ac83152b54a204b8148815a538d868973e1e1 (diff) |
flash: nor: mdr: fix verification problem with 1986VE1T or 1986VE3T
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>
Diffstat (limited to 'src')
-rw-r--r-- | src/flash/nor/mdr.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/flash/nor/mdr.c b/src/flash/nor/mdr.c index 68eaf137..374cb6f2 100644 --- a/src/flash/nor/mdr.c +++ b/src/flash/nor/mdr.c @@ -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; } |