summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/flash/str9x.c7
1 files changed, 7 insertions, 0 deletions
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;