OpenOCD JTAG interrogation failed: all ones

Spent the better part of the day on Google, looking for a resolution, but most hits resolve to questions about the hardware being bad. I hope the problem is with my config file and not with the hardware. The board in question functions otherwise and I can program it serially, so I don’t think it’s toasted. Anyone have any suggestions as to what to try next? Time to break out the o-scope and start watching the JTAG lines?

First, my OpenOCD setup:

-Windows 7 with MINGW

-Amontec JTAGkey-Tiny v1.0

-Amontec JTAGkey drivers v2.6.0.0

-LibUSB Filter v1.2.2.0

-OpenOCD 0.4.4 (2010-02-22-19:05) from Freddie Chopin’s msi installer

Now, hardware. I have two Keil eval boards:

  1. MCB1700 with a LPC1768

  2. MCB2300 with a LPC2387

Board #1 works fine with the file included with openocd (./board/keil_mcb1700.cfg) . The problem is that board #2 produces the following output:

$ openocd -f /s/embedded/lpc23xx/doc/lpc2387_jtag.cfg

Open On-Chip Debugger 0.4.0 (2010-02-22-19:05)

Licensed under GNU GPL v2

For bug reports, read

http://openocd.berlios.de/doc/doxygen/bugs.html

debug_level: 2

200 kHz

trst_and_srst srst_pulls_trst srst_gates_jtag trst_push_pull srst_

jtag_nsrst_delay: 100

jtag_ntrst_delay: 100

Info : clock speed 200 kHz

Error: JTAG scan chain interrogation failed: all ones

Error: Check JTAG interface, timings, target power, etc.

Error: JTAG scan chain interrogation failed: all ones

Error: Check JTAG interface, timings, target power, etc.

Command handler execution failed

Warn : jtag initialization failed; try ‘jtag init’ again.

I didn’t see any included config files for the second board, so I snipped together the following from other examples:

# OpenOCD config file for LPC2387

# minimal debugging
debug_level 1

# daemon configuration
telnet_port 4444
gdb_port 3333
tcl_port 6666

# interface
interface ft2232
ft2232_device_desc "Amontec JTAGkey"
ft2232_layout jtagkey
ft2232_vid_pid 0x0403 0xcff8

# speed
jtag_khz 200

# reset configuration
reset_config trst_and_srst srst_pulls_trst
jtag_nsrst_delay 100
jtag_ntrst_delay 100

# create a tap
jtag newtap lpc2387 cpu -irlen 4 -ircapture 0x1 -irmask 0xf -expected-id 0x4f1f0f0f

# create a target
target create lpc2387.cpu arm7tdmi -endian little -chain-position lpc2387.cpu -variant arm7tdmi-s_r4
lpc2387.cpu configure -work-area-phys 0x40000000 -work-area-size 0x10000 -work-area-backup 0

# flash configuration
flash bank lpc2000 0x0 0x80000 0 0 lpc2387.cpu lpc2000_v2 4000 calc_checksum

Turns out it was my JTAG adapter. I’m using a 10-pin JTAG header, along with the Embedded Artists 20-to-10 pin adapter. This works just fine on the Keil MCP1700 (after changing the “reset_config” option to “srst_only”), but since I’m using a LPC2468 on my board, I apparently need TRST. I tried lots of different permutations for “reset_config”, but then I added a discrete wire for TRST and it works.