From: Øyvind H. <go...@us...> - 2010-01-14 15:09:10
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via 24653c950a18c49d267efb17a36423d9c455a886 (commit) from e1679a29f084e3172077d513d14a0fde9ea2ea77 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 24653c950a18c49d267efb17a36423d9c455a886 Author: Laurentiu Cocanu <lau...@zy...> Date: Thu Jan 14 13:59:36 2010 +0100 str9x.c: remove optimization when erasing the whole bank Using the erase bank command will cause a time out error. Replacing this with the erase sector bank will provide a slower but safer and stable method to erase the flash. Signed-off-by: Laurentiu Cocanu <lau...@zy...> Signed-off-by: Ãyvind Harboe <oyv...@zy...> diff --git a/src/flash/nor/str9x.c b/src/flash/nor/str9x.c index bf3f750..d0c1278 100644 --- a/src/flash/nor/str9x.c +++ b/src/flash/nor/str9x.c @@ -230,17 +230,9 @@ static int str9x_erase(struct flash_bank *bank, int first, int last) return ERROR_TARGET_NOT_HALTED; } - /* Check if we erase whole bank */ - if ((first == 0) && (last == (bank->num_sectors - 1))) - { - /* Optimize to run erase bank command instead of sector */ - erase_cmd = 0x80; - } - else - { - /* Erase sector command */ - erase_cmd = 0x20; - } + /*A slower but stable way of erasing*/ + /* Erase sector command */ + erase_cmd = 0x20; for (i = first; i <= last; i++) { @@ -296,10 +288,6 @@ static int str9x_erase(struct flash_bank *bank, int first, int last) LOG_ERROR("error erasing flash bank, status: 0x%x", status); return ERROR_FLASH_OPERATION_FAILED; } - - /* If we ran erase bank command, we are finished */ - if (erase_cmd == 0x80) - break; } for (i = first; i <= last; i++) ----------------------------------------------------------------------- Summary of changes: src/flash/nor/str9x.c | 18 +++--------------- 1 files changed, 3 insertions(+), 15 deletions(-) hooks/post-receive -- Main OpenOCD repository |