I just got an Olimex ARM-USB-OCD and have high hopes.
But right now I’m getting:
Info: openocd.c:73 main(): Open On-Chip Debugger (Revision 62)
Error: jtag.c:1091 jtag_validate_chain(): Error validating JTAG scan chain, IR mismatch
When trying to start openocd from Eclipse. I get the same problem running it from the command prompt (WinXP). And I get the same problem when the JTAG cable is disconnected at the board (LPC2129 from Olimex). But I’m pretty sure there is communications happening between the PC and the ARM-USB-OCD as the unit’s green led turns amber when this happens.
Here’s the configuration file
#daemon configuration
telnet_port 4444
gdb_port 3333
#interface
interface ftd2xx
ftd2xx_device_desc "Olimex OpenOCD JTAG A"
ftd2xx_layout olimex_jtag
#ftd2xx_vid_pid 0x0403 0xcff8
ftd2xx_vid_pid 0x15ba 0x0003
jtag_speed 2
#use combined on interfaces or targets that can't set TRST/SRST separately
reset_config trst_and_srst srst_pulls_trst
#jtag scan chain
#format L IRC IRCM IDCODE (Length, IR Capture, IR Capture Mask, IDCODE)
jtag_device 4 0x1 0xf 0xe
#target configuration
daemon_startup reset
#target <type> <startup mode>
#target arm7tdmi <reset mode> <chainpos> <endianness> <variant>
#target arm7tdmi little run_and_halt 0 arm7tdmi-s_r4
target arm7tdmi little run_and_init 0 arm7tdmi-s_r4
run_and_halt_time 0 30
target_script 0 reset oocd_flash2106.script
working_area 0 0x40000000 0x4000 nobackup
#flash configuration
#flash bank lpc2000 0x0 0x40000 0 0 lpc2000_v1 0 14765 calc_checksum
flash bank lpc2000 0x0 0x40000 0 0 lpc2000_v1 0 14765 calc_checksum
# For more information about the configuration files, take a look at:
# http://openfacts.berlios.de/index-en.phtml?title=Open+On-Chip+Debugger
Sorry, I don’t have a ARM-USB-OCD yet (though Olimex wanted to send me one, guess it should arrive soon now), and I don’t know about the changes they made to the code.
Communication between the PC and the ARM-USB-OCD is definitely working, otherwise there would be a error message indicating communication with the FT2232 failed.
You could try reducing the speed of the JTAG communication, by increasing the jtag_speed value, which controls the TCK divisor. Try values of 3, 4 or 5.
Thanks for the suggestion, but no joy. I tried jtag_speed values sequentially through 9 and it always behaved the same. I actually have 2 of these ARM-USB-OCD units and they have identical behavior. I’ve also tried against a second 2129 board - both boards work with the Olimex wiggler clone. I don’t know what to do next and I think the Olimex guys have begun a long vacation.
I don’t see any real documentation of the unit in their “ARM GCC for Windows Dummies” distribution. The setup, however, did install exactly as advertised - extremely simple.
Correcting original post: I did find an archive of openocd source code in the distribution which I assume is the basis for their executable - but I wouldn’t know what changes would be material or telling. I’d be happy to send it onward.
I spent a few frustrating days but I did get it to work with an olimex at91sam7s256 header board. Now life is good again. I did several things. I am not sure if they were all required.
First, it is easy to see what olimex did with the code. Just go into the directory where you un archived it and type svn diff. This will show that he added three functions and a couple variables if I remember. Just add that to the latest revision and recompile.
The other thing I did was to edit the config file and made the following changes:
reset_config none
target arm7tdmi little run_and_init 0 arm7tdmi-s_r4
I was just trying to follow Tommy’s advice when I found olimex ARM-USB-OCD specific code in the latest version - r89. The code looks updated from the stuff that shipped with the product. I’ll try building it on Cygwin tomorrow and let you know.
BTW, Dominic, does this mean you received a unit from Olimex?
Thanks Michael - the yagarto build seems to work well. Now when I run openocd I don’t get any error messages and the LED on the unit flashes alternately between orange and green and MS firewall noticed the application. I haven’t gotten beyond that - I have to clean up my system from multiple installs of cygwin. Question - should I be able to use the yagarto build of openocd with the cygwin arm gcc toolchain?
One thing I ran in to - the #interface section in the openocd configuration file needs to change from what shipped with Olimex’s gcc-for-dummies CD and referenced above. It should now read:
#interface
interface ft2232
ft2232_device_desc “Olimex OpenOCD JTAG A”
ft2232_layout olimex-jtag
#ftd2xx_vid_pid 0x0403 0xcff8
ftd22232_vid_pid 0x15ba 0x0003
jtag_speed 2
I was still hoping to build openocd for cygwin, but I ran into trouble following the wiki build page:
where the path is the location of the ftd2xx drivers shipped by olimex. But when I do this the make stops quickly, complaining of multiple target patterns. So I try config with just the second parameter and the make works fine, but I can’t run it - it doesn’t include the ft2232 interface.