Hi,
My hardware is:
Olimex ARM-USB-OCD JTAG interface.
Olimex LPC-P2129 (powered by 9v output of ARM-USB-OCD).
My software is:
OpenOCD r204 on Gentoo Linux, 2.6.17-gentoo-r7 running on AMD Sempron processor. I have libftdi 0.7 installed. I built openocd on this machine using
bootstrap
configure --enable-ft2232-libftdi
make
sudo make install
My config file is:
#daemon configuration
telnet_port 4444
gdb_port 3333
#interface
interface ft2232
ft2232_layout olimex-jtag
ft2232_vid_pid 0x15BA 0x0003
jtag_speed 40
#use combined on interfaces or targets that can't set TRST/SRST separately
reset_config trst_and_srst srst_pulls_trst
#jtag scan chain
jtag_device 4 0x1 0xf 0xe
daemon_startup reset
target arm7tdmi little run_and_halt 0 arm7tdmi-s_r4
run_and_halt_time 0 500
working_area 0 0x40003000 0x1000 nobackup
#flash configuration
flash bank lpc2000 0x0 0x40000 0 0 0 lpc2000_v1 calc_checksum
Problem:
If I unplug the ARM-USB-OCD from the USB interface and replug it, it works - I get:
$ openocd
Info: openocd.c:93 main(): Open On-Chip Debugger (2007-09-05 09:00 CEST)
Warning: arm7_9_common.c:734 arm7_9_assert_reset(): srst resets test logic, too
Info: server.c:67 add_connection(): accepted 'telnet' connection from 0
Info: server.c:360 server_loop(): dropped 'telnet' connection
I can telnet to 4444 and execute the poll command, getting the expected results, so all is well.
Now if I execute the shutdown command to exit openocd and then re-run openocd it fails:
$ openocd
Info: openocd.c:93 main(): Open On-Chip Debugger (2007-09-05 09:00 CEST)
Error: jtag.c:1253 jtag_examine_chain(): JTAG communication failure, check connection, JTAG interface, target power etc.
Error: jtag.c:1440 jtag_init(): trying to validate configured JTAG chain anyway...
Error: jtag.c:1346 jtag_validate_chain(): Error validating JTAG scan chain, IR mismatch, scan returned 0x3f
Error: jtag.c:1346 jtag_validate_chain(): Error validating JTAG scan chain, IR mismatch, scan returned 0x3f
Error: jtag.c:1346 jtag_validate_chain(): Error validating JTAG scan chain, IR mismatch, scan returned 0x3f
Error: jtag.c:1346 jtag_validate_chain(): Error validating JTAG scan chain, IR mismatch, scan returned 0x3f
Error: jtag.c:1346 jtag_validate_chain(): Error validating JTAG scan chain, IR mismatch, scan returned 0x3f
Error: jtag.c:1346 jtag_validate_chain(): Error validating JTAG scan chain, IR mismatch, scan returned 0x3f
Error: jtag.c:1448 jtag_init(): Could not validate JTAG chain, exit
At this point pressing the reset button (or power cycling) the P2129 doesn’t fix it - only unplugging and replugging the ARM-USB-OCD.
Note it doesn’t always fail first time, but always within a couple of runs.
So I am assuming the FT2232 chip or the JTAG state machine is in not in the expected state. Now I think the USB comms to the FT2232 is OK because the layout->blink() command that is executed as part of the jtag_initialise() call does make the LED blink, even when jtag_examine_chain() goes on to fail.
Any ideas about how to debug this (I’m happy to spend time in GDB, but I don’t know much about JTAG itself or the FTDI chip behaviour).
Thanks in advance for any help you can offer,
Robin Iddon