summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/target/arm7_9_common.c6
-rw-r--r--src/target/target.c5
2 files changed, 11 insertions, 0 deletions
diff --git a/src/target/arm7_9_common.c b/src/target/arm7_9_common.c
index e5969806..a09b0ad9 100644
--- a/src/target/arm7_9_common.c
+++ b/src/target/arm7_9_common.c
@@ -2797,6 +2797,12 @@ COMMAND_HANDLER(handle_arm7_9_semihosting_command)
COMMAND_PARSE_ENABLE(CMD_ARGV[0], semihosting);
+ if (!target_was_examined(target))
+ {
+ LOG_ERROR("Target not examined yet");
+ return ERROR_FAIL;
+ }
+
if (arm7_9->has_vector_catch) {
struct reg *vector_catch = &arm7_9->eice_cache
->reg_list[EICE_VEC_CATCH];
diff --git a/src/target/target.c b/src/target/target.c
index 8cb53b36..d3d1beee 100644
--- a/src/target/target.c
+++ b/src/target/target.c
@@ -4079,6 +4079,11 @@ static int jim_target_reset(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
struct target *target = Jim_CmdPrivData(goi.interp);
if (!target->tap->enabled)
return jim_target_tap_disabled(interp);
+ if (!(target_was_examined(target)))
+ {
+ LOG_ERROR("Target not examined yet");
+ return ERROR_TARGET_NOT_EXAMINED;
+ }
if (!target->type->assert_reset || !target->type->deassert_reset)
{
Jim_SetResult_sprintf(interp,