aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomas Vanek <vanekt@fbl.cz>2019-01-19 14:58:49 +0100
committerTomas Vanek <vanekt@fbl.cz>2019-02-04 10:26:22 +0000
commite978e53c7710a3643abea628245a0e155ad4dfd9 (patch)
tree2f5db42029d5c5b21113ae7fb90eeba9b3ac2dea
parent4b998cb5f5d2066e5e0197fcc460831b09813f70 (diff)
downloadriscv-openocd-e978e53c7710a3643abea628245a0e155ad4dfd9.zip
riscv-openocd-e978e53c7710a3643abea628245a0e155ad4dfd9.tar.gz
riscv-openocd-e978e53c7710a3643abea628245a0e155ad4dfd9.tar.bz2
flash/nor/stm32f1x: fix minor error messages
Change-Id: I1e9e62979c4629c8ba1d5ae89ca7392259969eb6 Signed-off-by: Tomas Vanek <vanekt@fbl.cz> Reviewed-on: http://openocd.zylin.com/4858 Tested-by: jenkins Reviewed-by: Christopher Head <chead@zaber.com>
-rw-r--r--src/flash/nor/stm32f1x.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/flash/nor/stm32f1x.c b/src/flash/nor/stm32f1x.c
index fbd7598..a0144c2 100644
--- a/src/flash/nor/stm32f1x.c
+++ b/src/flash/nor/stm32f1x.c
@@ -443,8 +443,10 @@ static int stm32x_protect(struct flash_bank *bank, int set, int first, int last)
return retval;
retval = stm32x_erase_options(bank);
- if (retval != ERROR_OK)
+ if (retval != ERROR_OK) {
+ LOG_ERROR("stm32x failed to erase options");
return retval;
+ }
for (int i = first; i <= last; i++) {
if (set)
@@ -1227,12 +1229,12 @@ COMMAND_HANDLER(stm32x_handle_unlock_command)
return retval;
if (stm32x_erase_options(bank) != ERROR_OK) {
- command_print(CMD_CTX, "stm32x failed to unlock device");
+ command_print(CMD_CTX, "stm32x failed to erase options");
return ERROR_OK;
}
if (stm32x_write_options(bank) != ERROR_OK) {
- command_print(CMD_CTX, "stm32x failed to lock device");
+ command_print(CMD_CTX, "stm32x failed to unlock device");
return ERROR_OK;
}