Also this makes it possible to launch openocd with the dummy driver
again.

-- 
Øyvind Harboe
US toll free 1-866-980-3434 / International +47 51 63 25 00
http://www.zylin.com/zy1000.html
ARM7 ARM9 ARM11 XScale Cortex
JTAG debugger and flash programmer
From 8ae875a41bd798534802333717fa13ab9e7bf571 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=98yvind=20Harboe?= <oyvind.har...@zylin.com>
Date: Wed, 1 Sep 2010 23:36:31 +0200
Subject: [PATCH] djtag: fix regression when starting OpenOCD with target powered down
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Do not fail startup if communication with target is
not possible.

OpenOCD supports launching without a target connected
or the target powered down.

The user will typically power up the target and issue
a "reset init" + load his application after OpenOCD
is started then.

Signed-off-by: Øyvind Harboe <oyvind.har...@zylin.com>
---
 src/jtag/core.c |   18 +++++++++++++-----
 1 files changed, 13 insertions(+), 5 deletions(-)

diff --git a/src/jtag/core.c b/src/jtag/core.c
index 1068681..6f9d92a 100644
--- a/src/jtag/core.c
+++ b/src/jtag/core.c
@@ -1445,17 +1445,19 @@ int jtag_init_inner(struct command_context *cmd_ctx)
 	case ERROR_OK:
 		/* complete success */
 		break;
-	case ERROR_JTAG_INIT_SOFT_FAIL:
+	default:
 		/* For backward compatibility reasons, try coping with
 		 * configuration errors involving only ID mismatches.
 		 * We might be able to talk to the devices.
+		 *
+		 * Also the device might be powered down during startup.
+		 *
+		 * After OpenOCD starts, we can try to power on the device
+		 * and run a reset.
 		 */
 		LOG_ERROR("Trying to use configured scan chain anyway...");
 		issue_setup = false;
 		break;
-	default:
-		/* some hard error; already issued diagnostics */
-		return retval;
 	}
 
 	/* Now look at IR values.  Problems here will prevent real
@@ -1466,7 +1468,13 @@ int jtag_init_inner(struct command_context *cmd_ctx)
 	 */
 	retval = jtag_validate_ircapture();
 	if (retval != ERROR_OK)
-		return retval;
+	{
+		/* The target might be powered down. The user
+		 * can power it up and reset it after firing
+		 * up OpenOCD.
+		 */
+		issue_setup = false;
+	}
 
 	if (issue_setup)
 		jtag_notify_event(JTAG_TAP_EVENT_SETUP);
-- 
1.7.0.4

_______________________________________________
Openocd-development mailing list
Openocd-development@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/openocd-development

Reply via email to