diff options
author | ntfreak <ntfreak@b42882b7-edfa-0310-969c-e2dbd0fdcd60> | 2008-04-26 12:50:03 +0000 |
---|---|---|
committer | ntfreak <ntfreak@b42882b7-edfa-0310-969c-e2dbd0fdcd60> | 2008-04-26 12:50:03 +0000 |
commit | 5d6c997b514e3a8cde971ae3090004ab54ba1d2f (patch) | |
tree | 7f7cb896fd3cb823b1043bf113dd424bb88144f2 /src/flash | |
parent | 1c50c0f3c7d220fc5a1c7a1b1d1dde53eaecd4e6 (diff) | |
download | openocd+libswd-5d6c997b514e3a8cde971ae3090004ab54ba1d2f.tar.gz openocd+libswd-5d6c997b514e3a8cde971ae3090004ab54ba1d2f.tar.bz2 openocd+libswd-5d6c997b514e3a8cde971ae3090004ab54ba1d2f.tar.xz openocd+libswd-5d6c997b514e3a8cde971ae3090004ab54ba1d2f.zip |
- 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
Diffstat (limited to 'src/flash')
-rw-r--r-- | src/flash/str9x.c | 7 |
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; |