diff options
author | oharboe <oharboe@b42882b7-edfa-0310-969c-e2dbd0fdcd60> | 2009-04-27 09:12:18 +0000 |
---|---|---|
committer | oharboe <oharboe@b42882b7-edfa-0310-969c-e2dbd0fdcd60> | 2009-04-27 09:12:18 +0000 |
commit | 1c28cbab0241b400cc7a7fc2e3f7170b0c7a952e (patch) | |
tree | 3b1bf62a077eb11f09dc8f0155030ebda2e69658 /src | |
parent | b0d04ab6c6c2a04130a72124e79fede7655032e2 (diff) | |
download | openocd_libswd-1c28cbab0241b400cc7a7fc2e3f7170b0c7a952e.tar.gz openocd_libswd-1c28cbab0241b400cc7a7fc2e3f7170b0c7a952e.tar.bz2 openocd_libswd-1c28cbab0241b400cc7a7fc2e3f7170b0c7a952e.tar.xz openocd_libswd-1c28cbab0241b400cc7a7fc2e3f7170b0c7a952e.zip |
Some devices such as AVR will return 0xffffffff instead of the TDI
data at the end of the chain. Added kludge to handle this.
git-svn-id: svn://svn.berlios.de/openocd/trunk@1537 b42882b7-edfa-0310-969c-e2dbd0fdcd60
Diffstat (limited to 'src')
-rw-r--r-- | src/jtag/jtag.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/jtag/jtag.c b/src/jtag/jtag.c index 408f88fa..59f19916 100644 --- a/src/jtag/jtag.c +++ b/src/jtag/jtag.c @@ -1531,7 +1531,9 @@ int jtag_examine_chain(void) u32 part; u32 version; - if (idcode == 0x000000FF) + /* some devices, such as AVR will output all 1's instead of TDI + input value at end of chain. */ + if ((idcode == 0x000000FF)||(idcode == 0xFFFFFFFF)) { int unexpected=0; /* End of chain (invalid manufacturer ID) @@ -1548,7 +1550,7 @@ int jtag_examine_chain(void) for (bit_count += 32; bit_count < (JTAG_MAX_CHAIN_SIZE * 32) - 31;bit_count += 32) { idcode = buf_get_u32(idcode_buffer, bit_count, 32); - if (unexpected||(idcode != 0x000000FF)) + if (unexpected||((idcode != 0x000000FF)&&(idcode != 0xFFFFFFFF))) { LOG_WARNING("Unexpected idcode after end of chain! %d 0x%08x", bit_count, idcode); unexpected = 1; @@ -3306,7 +3308,7 @@ tap_state_t jtag_debug_state_machine(const void *tms_buf, const void *tdi_buf, tap_state_t last_state; - // set startstate (and possibly last, if tap_bits == 0) + // set startstate (and possibly last, if tap_bits == 0) last_state = next_state; DEBUG_JTAG_IO("TAP/SM: START state: %s", tap_state_name(next_state)); |