summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordbrownell <dbrownell@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2009-10-05 08:23:33 +0000
committerdbrownell <dbrownell@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2009-10-05 08:23:33 +0000
commit7a57c316196f93c7e31b7d00eb9b52177ae874c6 (patch)
tree7f7e84b2ff0014e98a089a284afb5841086cbd2d
parent7c7467b34f11939fbce41e39dfa1b6b0e110a89c (diff)
downloadopenocd_libswd-7a57c316196f93c7e31b7d00eb9b52177ae874c6.tar.gz
openocd_libswd-7a57c316196f93c7e31b7d00eb9b52177ae874c6.tar.bz2
openocd_libswd-7a57c316196f93c7e31b7d00eb9b52177ae874c6.tar.xz
openocd_libswd-7a57c316196f93c7e31b7d00eb9b52177ae874c6.zip
Improve jtag_validate_ircapture() diagnostics.
Bugfix the error message so it shows the disliked value, and add a debug message showing each TAP's IR capture value, all N bits. This just changes diagnostics ... it still ignores the parameters given to us at TAP declaration time. git-svn-id: svn://svn.berlios.de/openocd/trunk@2801 b42882b7-edfa-0310-969c-e2dbd0fdcd60
-rw-r--r--src/jtag/core.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/jtag/core.c b/src/jtag/core.c
index 12850404..07eec64f 100644
--- a/src/jtag/core.c
+++ b/src/jtag/core.c
@@ -1068,6 +1068,7 @@ static int jtag_validate_ircapture(void)
int total_ir_length = 0;
uint8_t *ir_test = NULL;
scan_field_t field;
+ int val;
int chain_pos = 0;
int retval;
@@ -1100,7 +1101,7 @@ static int jtag_validate_ircapture(void)
tap = NULL;
chain_pos = 0;
- int val;
+
for (;;) {
tap = jtag_tap_next_enabled(tap);
if (tap == NULL) {
@@ -1111,17 +1112,18 @@ static int jtag_validate_ircapture(void)
* REVISIT we might be able to verify some MSBs too, using
* ircapture/irmask attributes.
*/
- val = buf_get_u32(ir_test, chain_pos, 2);
- if (val != 1) {
- char *cbuf = buf_to_str(ir_test, total_ir_length, 16);
-
- LOG_ERROR("%s: IR capture error; saw 0x%s not 0x..1",
- jtag_tap_name(tap), cbuf);
+ val = buf_get_u32(ir_test, chain_pos, tap->ir_length);
+ if ((val & 0x3) != 1) {
+ LOG_ERROR("%s: IR capture error; saw 0x%0*x not 0x..1",
+ jtag_tap_name(tap),
+ (tap->ir_length + 7) / tap->ir_length,
+ val);
- free(cbuf);
retval = ERROR_JTAG_INIT_FAILED;
goto done;
}
+ LOG_DEBUG("%s: IR capture 0x%0*x", jtag_tap_name(tap),
+ (tap->ir_length + 7) / tap->ir_length, val);
chain_pos += tap->ir_length;
}