From 5d6c997b514e3a8cde971ae3090004ab54ba1d2f Mon Sep 17 00:00:00 2001 From: ntfreak Date: Sat, 26 Apr 2008 12:50:03 +0000 Subject: - change str9 flash controller to read array after a level 1 protect git-svn-id: svn://svn.berlios.de/openocd/trunk@619 b42882b7-edfa-0310-969c-e2dbd0fdcd60 --- src/flash/str9x.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/flash/str9x.c b/src/flash/str9x.c index 30c4e980..150f0f87 100644 --- a/src/flash/str9x.c +++ b/src/flash/str9x.c @@ -216,6 +216,7 @@ int str9x_protect_check(struct flash_bank_s *bank) target_read_u16(target, adr, (u16*)&status); } + /* read array command */ target_write_u16(target, adr, 0xFF); for (i = 0; i < bank->num_sectors; i++) @@ -304,6 +305,12 @@ int str9x_protect(struct flash_bank_s *bank, int set, int first, int last) /* query status */ target_read_u8(target, adr, &status); + + /* clear status, also clear read array */ + target_write_u16(target, adr, 0x50); + + /* read array command */ + target_write_u16(target, adr, 0xFF); } return ERROR_OK; -- cgit v1.2.3