summaryrefslogtreecommitdiff
path: root/src/flash
diff options
context:
space:
mode:
authoroharboe <oharboe@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2008-08-17 19:40:17 +0000
committeroharboe <oharboe@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2008-08-17 19:40:17 +0000
commit330cf5a6bb23063947d9cff661b61a82d3221c7a (patch)
tree3743176cd90c2e41791a79cf20a11db748e11dda /src/flash
parentc1683a55bc6cce7cb54a30789b9d15443b557b69 (diff)
downloadopenocd+libswd-330cf5a6bb23063947d9cff661b61a82d3221c7a.tar.gz
openocd+libswd-330cf5a6bb23063947d9cff661b61a82d3221c7a.tar.bz2
openocd+libswd-330cf5a6bb23063947d9cff661b61a82d3221c7a.tar.xz
openocd+libswd-330cf5a6bb23063947d9cff661b61a82d3221c7a.zip
fixed not halted error messages
git-svn-id: svn://svn.berlios.de/openocd/trunk@925 b42882b7-edfa-0310-969c-e2dbd0fdcd60
Diffstat (limited to 'src/flash')
-rw-r--r--src/flash/at91sam7.c5
-rw-r--r--src/flash/cfi.c7
-rw-r--r--src/flash/flash.c2
-rw-r--r--src/flash/lpc2000.c4
-rw-r--r--src/flash/lpc288x.c2
-rw-r--r--src/flash/stellaris.c6
-rw-r--r--src/flash/stm32x.c10
-rw-r--r--src/flash/str7x.c5
-rw-r--r--src/flash/str9x.c5
-rw-r--r--src/flash/tms470.c5
10 files changed, 51 insertions, 0 deletions
diff --git a/src/flash/at91sam7.c b/src/flash/at91sam7.c
index 7aba6db4..8c73601c 100644
--- a/src/flash/at91sam7.c
+++ b/src/flash/at91sam7.c
@@ -588,6 +588,7 @@ int at91sam7_protect_check(struct flash_bank_s *bank)
if (bank->target->state != TARGET_HALTED)
{
+ LOG_ERROR("Target not halted");
return ERROR_TARGET_NOT_HALTED;
}
@@ -636,6 +637,7 @@ int at91sam7_erase(struct flash_bank_s *bank, int first, int last)
if (bank->target->state != TARGET_HALTED)
{
+ LOG_ERROR("Target not halted");
return ERROR_TARGET_NOT_HALTED;
}
@@ -679,6 +681,7 @@ int at91sam7_protect(struct flash_bank_s *bank, int set, int first, int last)
if (bank->target->state != TARGET_HALTED)
{
+ LOG_ERROR("Target not halted");
return ERROR_TARGET_NOT_HALTED;
}
@@ -728,6 +731,7 @@ int at91sam7_write(struct flash_bank_s *bank, u8 *buffer, u32 offset, u32 count)
if (bank->target->state != TARGET_HALTED)
{
+ LOG_ERROR("Target not halted");
return ERROR_TARGET_NOT_HALTED;
}
@@ -795,6 +799,7 @@ int at91sam7_probe(struct flash_bank_s *bank)
if (bank->target->state != TARGET_HALTED)
{
+ LOG_ERROR("Target not halted");
return ERROR_TARGET_NOT_HALTED;
}
diff --git a/src/flash/cfi.c b/src/flash/cfi.c
index 5f64e116..68f9a0ad 100644
--- a/src/flash/cfi.c
+++ b/src/flash/cfi.c
@@ -747,6 +747,7 @@ int cfi_erase(struct flash_bank_s *bank, int first, int last)
if (bank->target->state != TARGET_HALTED)
{
+ LOG_ERROR("Target not halted");
return ERROR_TARGET_NOT_HALTED;
}
@@ -878,6 +879,7 @@ int cfi_protect(struct flash_bank_s *bank, int set, int first, int last)
if (bank->target->state != TARGET_HALTED)
{
+ LOG_ERROR("Target not halted");
return ERROR_TARGET_NOT_HALTED;
}
@@ -1649,7 +1651,10 @@ int cfi_write(struct flash_bank_s *bank, u8 *buffer, u32 offset, u32 count)
int retval;
if (bank->target->state != TARGET_HALTED)
+ {
+ LOG_ERROR("Target not halted");
return ERROR_TARGET_NOT_HALTED;
+ }
if (offset + count > bank->size)
return ERROR_FLASH_DST_OUT_OF_BANK;
@@ -1877,6 +1882,7 @@ int cfi_probe(struct flash_bank_s *bank)
if (bank->target->state != TARGET_HALTED)
{
+ LOG_ERROR("Target not halted");
return ERROR_TARGET_NOT_HALTED;
}
@@ -2175,6 +2181,7 @@ int cfi_protect_check(struct flash_bank_s *bank)
if (bank->target->state != TARGET_HALTED)
{
+ LOG_ERROR("Target not halted");
return ERROR_TARGET_NOT_HALTED;
}
diff --git a/src/flash/flash.c b/src/flash/flash.c
index 5193ce9a..9178ff9c 100644
--- a/src/flash/flash.c
+++ b/src/flash/flash.c
@@ -1119,6 +1119,7 @@ int default_flash_mem_blank_check(struct flash_bank_s *bank)
if (bank->target->state != TARGET_HALTED)
{
+ LOG_ERROR("Target not halted");
return ERROR_TARGET_NOT_HALTED;
}
@@ -1165,6 +1166,7 @@ int default_flash_blank_check(struct flash_bank_s *bank)
if (bank->target->state != TARGET_HALTED)
{
+ LOG_ERROR("Target not halted");
return ERROR_TARGET_NOT_HALTED;
}
diff --git a/src/flash/lpc2000.c b/src/flash/lpc2000.c
index 7a82a720..f449380e 100644
--- a/src/flash/lpc2000.c
+++ b/src/flash/lpc2000.c
@@ -418,6 +418,7 @@ int lpc2000_erase(struct flash_bank_s *bank, int first, int last)
if (bank->target->state != TARGET_HALTED)
{
+ LOG_ERROR("Target not halted");
return ERROR_TARGET_NOT_HALTED;
}
@@ -484,6 +485,7 @@ int lpc2000_write(struct flash_bank_s *bank, u8 *buffer, u32 offset, u32 count)
if (bank->target->state != TARGET_HALTED)
{
+ LOG_ERROR("Target not halted");
return ERROR_TARGET_NOT_HALTED;
}
@@ -641,6 +643,7 @@ int lpc2000_erase_check(struct flash_bank_s *bank)
{
if (bank->target->state != TARGET_HALTED)
{
+ LOG_ERROR("Target not halted");
return ERROR_TARGET_NOT_HALTED;
}
@@ -683,6 +686,7 @@ int lpc2000_handle_part_id_command(struct command_context_s *cmd_ctx, char *cmd,
if (bank->target->state != TARGET_HALTED)
{
+ LOG_ERROR("Target not halted");
return ERROR_TARGET_NOT_HALTED;
}
diff --git a/src/flash/lpc288x.c b/src/flash/lpc288x.c
index 09f4be85..3e22dd56 100644
--- a/src/flash/lpc288x.c
+++ b/src/flash/lpc288x.c
@@ -270,6 +270,7 @@ u32 lpc288x_system_ready(struct flash_bank_s *bank)
if (bank->target->state != TARGET_HALTED)
{
+ LOG_ERROR("Target not halted");
return ERROR_TARGET_NOT_HALTED;
}
return ERROR_OK;
@@ -456,6 +457,7 @@ int lpc288x_probe(struct flash_bank_s *bank)
if (bank->target->state != TARGET_HALTED)
{
+ LOG_ERROR("Target not halted");
return ERROR_TARGET_NOT_HALTED;
}
diff --git a/src/flash/stellaris.c b/src/flash/stellaris.c
index c4bc4dce..fa944519 100644
--- a/src/flash/stellaris.c
+++ b/src/flash/stellaris.c
@@ -520,6 +520,7 @@ int stellaris_protect_check(struct flash_bank_s *bank)
if (bank->target->state != TARGET_HALTED)
{
+ LOG_ERROR("Target not halted");
return ERROR_TARGET_NOT_HALTED;
}
@@ -549,6 +550,7 @@ int stellaris_erase(struct flash_bank_s *bank, int first, int last)
if (bank->target->state != TARGET_HALTED)
{
+ LOG_ERROR("Target not halted");
return ERROR_TARGET_NOT_HALTED;
}
@@ -619,6 +621,7 @@ int stellaris_protect(struct flash_bank_s *bank, int set, int first, int last)
if (bank->target->state != TARGET_HALTED)
{
+ LOG_ERROR("Target not halted");
return ERROR_TARGET_NOT_HALTED;
}
@@ -814,6 +817,7 @@ int stellaris_write(struct flash_bank_s *bank, u8 *buffer, u32 offset, u32 count
if (bank->target->state != TARGET_HALTED)
{
+ LOG_ERROR("Target not halted");
return ERROR_TARGET_NOT_HALTED;
}
@@ -915,6 +919,7 @@ int stellaris_probe(struct flash_bank_s *bank)
if (bank->target->state != TARGET_HALTED)
{
+ LOG_ERROR("Target not halted");
return ERROR_TARGET_NOT_HALTED;
}
@@ -941,6 +946,7 @@ int stellaris_mass_erase(struct flash_bank_s *bank)
if (target->state != TARGET_HALTED)
{
+ LOG_ERROR("Target not halted");
return ERROR_TARGET_NOT_HALTED;
}
diff --git a/src/flash/stm32x.c b/src/flash/stm32x.c
index 4b25e74c..4a0dc434 100644
--- a/src/flash/stm32x.c
+++ b/src/flash/stm32x.c
@@ -293,6 +293,7 @@ int stm32x_protect_check(struct flash_bank_s *bank)
if (target->state != TARGET_HALTED)
{
+ LOG_ERROR("Target not halted");
return ERROR_TARGET_NOT_HALTED;
}
@@ -359,6 +360,7 @@ int stm32x_erase(struct flash_bank_s *bank, int first, int last)
if (bank->target->state != TARGET_HALTED)
{
+ LOG_ERROR("Target not halted");
return ERROR_TARGET_NOT_HALTED;
}
@@ -404,6 +406,7 @@ int stm32x_protect(struct flash_bank_s *bank, int set, int first, int last)
if (target->state != TARGET_HALTED)
{
+ LOG_ERROR("Target not halted");
return ERROR_TARGET_NOT_HALTED;
}
@@ -596,6 +599,7 @@ int stm32x_write(struct flash_bank_s *bank, u8 *buffer, u32 offset, u32 count)
if (bank->target->state != TARGET_HALTED)
{
+ LOG_ERROR("Target not halted");
return ERROR_TARGET_NOT_HALTED;
}
@@ -691,6 +695,7 @@ int stm32x_probe(struct flash_bank_s *bank)
if (bank->target->state != TARGET_HALTED)
{
+ LOG_ERROR("Target not halted");
return ERROR_TARGET_NOT_HALTED;
}
@@ -872,6 +877,7 @@ int stm32x_handle_lock_command(struct command_context_s *cmd_ctx, char *cmd, cha
if (target->state != TARGET_HALTED)
{
+ LOG_ERROR("Target not halted");
return ERROR_TARGET_NOT_HALTED;
}
@@ -920,6 +926,7 @@ int stm32x_handle_unlock_command(struct command_context_s *cmd_ctx, char *cmd, c
if (target->state != TARGET_HALTED)
{
+ LOG_ERROR("Target not halted");
return ERROR_TARGET_NOT_HALTED;
}
@@ -966,6 +973,7 @@ int stm32x_handle_options_read_command(struct command_context_s *cmd_ctx, char *
if (target->state != TARGET_HALTED)
{
+ LOG_ERROR("Target not halted");
return ERROR_TARGET_NOT_HALTED;
}
@@ -1024,6 +1032,7 @@ int stm32x_handle_options_write_command(struct command_context_s *cmd_ctx, char
if (target->state != TARGET_HALTED)
{
+ LOG_ERROR("Target not halted");
return ERROR_TARGET_NOT_HALTED;
}
@@ -1080,6 +1089,7 @@ int stm32x_mass_erase(struct flash_bank_s *bank)
if (target->state != TARGET_HALTED)
{
+ LOG_ERROR("Target not halted");
return ERROR_TARGET_NOT_HALTED;
}
diff --git a/src/flash/str7x.c b/src/flash/str7x.c
index facd873d..797fe2bc 100644
--- a/src/flash/str7x.c
+++ b/src/flash/str7x.c
@@ -230,6 +230,7 @@ int str7x_protect_check(struct flash_bank_s *bank)
if (bank->target->state != TARGET_HALTED)
{
+ LOG_ERROR("Target not halted");
return ERROR_TARGET_NOT_HALTED;
}
@@ -258,6 +259,7 @@ int str7x_erase(struct flash_bank_s *bank, int first, int last)
if (bank->target->state != TARGET_HALTED)
{
+ LOG_ERROR("Target not halted");
return ERROR_TARGET_NOT_HALTED;
}
@@ -309,6 +311,7 @@ int str7x_protect(struct flash_bank_s *bank, int set, int first, int last)
if (bank->target->state != TARGET_HALTED)
{
+ LOG_ERROR("Target not halted");
return ERROR_TARGET_NOT_HALTED;
}
@@ -481,6 +484,7 @@ int str7x_write(struct flash_bank_s *bank, u8 *buffer, u32 offset, u32 count)
if (bank->target->state != TARGET_HALTED)
{
+ LOG_ERROR("Target not halted");
return ERROR_TARGET_NOT_HALTED;
}
@@ -671,6 +675,7 @@ int str7x_handle_disable_jtag_command(struct command_context_s *cmd_ctx, char *c
if (target->state != TARGET_HALTED)
{
+ LOG_ERROR("Target not halted");
return ERROR_TARGET_NOT_HALTED;
}
diff --git a/src/flash/str9x.c b/src/flash/str9x.c
index 7468c3fb..5e28d307 100644
--- a/src/flash/str9x.c
+++ b/src/flash/str9x.c
@@ -192,6 +192,7 @@ int str9x_protect_check(struct flash_bank_s *bank)
if (bank->target->state != TARGET_HALTED)
{
+ LOG_ERROR("Target not halted");
return ERROR_TARGET_NOT_HALTED;
}
@@ -243,6 +244,7 @@ int str9x_erase(struct flash_bank_s *bank, int first, int last)
if (bank->target->state != TARGET_HALTED)
{
+ LOG_ERROR("Target not halted");
return ERROR_TARGET_NOT_HALTED;
}
@@ -308,6 +310,7 @@ int str9x_protect(struct flash_bank_s *bank, int set, int first, int last)
if (bank->target->state != TARGET_HALTED)
{
+ LOG_ERROR("Target not halted");
return ERROR_TARGET_NOT_HALTED;
}
@@ -459,6 +462,7 @@ int str9x_write(struct flash_bank_s *bank, u8 *buffer, u32 offset, u32 count)
if (bank->target->state != TARGET_HALTED)
{
+ LOG_ERROR("Target not halted");
return ERROR_TARGET_NOT_HALTED;
}
@@ -626,6 +630,7 @@ int str9x_handle_flash_config_command(struct command_context_s *cmd_ctx, char *c
if (bank->target->state != TARGET_HALTED)
{
+ LOG_ERROR("Target not halted");
return ERROR_TARGET_NOT_HALTED;
}
diff --git a/src/flash/tms470.c b/src/flash/tms470.c
index f74f3ffc..f9d8cd79 100644
--- a/src/flash/tms470.c
+++ b/src/flash/tms470.c
@@ -774,6 +774,7 @@ int tms470_erase(struct flash_bank_s *bank, int first, int last)
if (bank->target->state != TARGET_HALTED)
{
+ LOG_ERROR("Target not halted");
return ERROR_TARGET_NOT_HALTED;
}
@@ -822,6 +823,7 @@ int tms470_protect(struct flash_bank_s *bank, int set, int first, int last)
if (target->state != TARGET_HALTED)
{
+ LOG_ERROR("Target not halted");
return ERROR_TARGET_NOT_HALTED;
}
@@ -872,6 +874,7 @@ int tms470_write(struct flash_bank_s *bank, u8 * buffer, u32 offset, u32 count)
if (target->state != TARGET_HALTED)
{
+ LOG_ERROR("Target not halted");
return ERROR_TARGET_NOT_HALTED;
}
@@ -992,6 +995,7 @@ int tms470_erase_check(struct flash_bank_s *bank)
if (target->state != TARGET_HALTED)
{
+ LOG_ERROR("Target not halted");
return ERROR_TARGET_NOT_HALTED;
}
@@ -1081,6 +1085,7 @@ int tms470_protect_check(struct flash_bank_s *bank)
if (target->state != TARGET_HALTED)
{
+ LOG_ERROR("Target not halted");
return ERROR_TARGET_NOT_HALTED;
}