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 a1cf1b52444c67b6c56ad58fe29be5a285b244cb (commit)
from 631514724db1772f9e08e1dcb564fe9205def57e (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 a1cf1b52444c67b6c56ad58fe29be5a285b244cb
Author: gcembed <gc...@gm...>
Date: Tue Jun 1 13:48:22 2010 +0200
stm32 : change returned value of mass_erase function
Hello,
"stm32x mass_erase" return ERROR_OK even if something goes wrong.
Here is a summary of changes :
* in stm32x_mass_erase : return ERROR_FLASH_OPERATION_FAILED when error
detected in FLASH_SR register;
* in COMMAND_HANDLER(stm32x_handle_mass_erase_command) : return the
returned value of stm32x_mass_erase().
I don't know if there is reason to always return ERROR_OK ?
Gaëtan
diff --git a/src/flash/nor/stm32x.c b/src/flash/nor/stm32x.c
index 8a3b832..47ed640 100644
--- a/src/flash/nor/stm32x.c
+++ b/src/flash/nor/stm32x.c
@@ -1196,13 +1196,13 @@ static int stm32x_mass_erase(struct flash_bank *bank)
if (status & FLASH_WRPRTERR)
{
LOG_ERROR("stm32x device protected");
- return ERROR_OK;
+ return ERROR_FLASH_OPERATION_FAILED;
}
if (status & FLASH_PGERR)
{
LOG_ERROR("stm32x device programming failed");
- return ERROR_OK;
+ return ERROR_FLASH_OPERATION_FAILED;
}
return ERROR_OK;
@@ -1223,7 +1223,8 @@ COMMAND_HANDLER(stm32x_handle_mass_erase_command)
if (ERROR_OK != retval)
return retval;
- if (stm32x_mass_erase(bank) == ERROR_OK)
+ retval = stm32x_mass_erase(bank);
+ if (retval == ERROR_OK)
{
/* set all sectors as erased */
for (i = 0; i < bank->num_sectors; i++)
@@ -1238,7 +1239,7 @@ COMMAND_HANDLER(stm32x_handle_mass_erase_command)
command_print(CMD_CTX, "stm32x mass erase failed");
}
- return ERROR_OK;
+ return retval;
}
static const struct command_registration stm32x_exec_command_handlers[] = {
-----------------------------------------------------------------------
Summary of changes:
src/flash/nor/stm32x.c | 9 +++++----
1 files changed, 5 insertions(+), 4 deletions(-)
hooks/post-receive
--
Main OpenOCD repository
|