From f6b50b8ea24f744c87b7cf04d5cc4bd3a0e9c80c Mon Sep 17 00:00:00 2001 From: Spencer Oliver Date: Tue, 21 Feb 2012 10:41:39 +0000 Subject: [PATCH] stlink: support expected-id 0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit This brings the stlink driver inline with the rest of OpenOCD. If the user configures the tap as -expected-id 0 then the IDCODE will be treated as a wildcard and ignored. Change-Id: I99160c69b2b40f5b1f608bb59ab6630894502fd8 Signed-off-by: Spencer Oliver Reviewed-on: http://openocd.zylin.com/476 Tested-by: jenkins Reviewed-by: Mathias Küster --- src/jtag/stlink/stlink_interface.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/jtag/stlink/stlink_interface.c b/src/jtag/stlink/stlink_interface.c index 9c0215f0..389ab3ff 100644 --- a/src/jtag/stlink/stlink_interface.c +++ b/src/jtag/stlink/stlink_interface.c @@ -67,7 +67,8 @@ int stlink_interface_init_target(struct target *t) for (ii = 0; ii < limit; ii++) { uint32_t expected = t->tap->expected_ids[ii]; - if (t->tap->idcode == expected) { + /* treat "-expected-id 0" as a "don't-warn" wildcard */ + if (!expected || (t->tap->idcode == expected)) { found = 1; break; } -- 2.39.5