SparkFun Forums 

Where electronics enthusiasts find answers.

Open source ARM Debugger
By karim
#17015
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
Code: Select all
#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
And here's the debug output
Code: Select all
Debug:   jtag.c:1145 jtag_init(): 
Debug:   ftd2xx.c:894 ftd2xx_init(): current latency timer: 2
Debug:   ftd2xx.c:1065 olimex_jtag_init(): 80 08 1b
Debug:   ftd2xx.c:1109 olimex_jtag_init(): 82 0b 0f
Debug:   ftd2xx.c:191 ftd2xx_speed(): 86 02 00
Debug:   jtag.c:229 jtag_call_event_callbacks(): jtag event: 1
Debug:   jtag.c:1039 jtag_reset_callback(): 
Debug:   jtag.c:229 jtag_call_event_callbacks(): jtag event: 1
Debug:   jtag.c:1039 jtag_reset_callback(): 
Error:   jtag.c:1091 jtag_validate_chain(): Error validating JTAG scan chain, IR mismatch
What should I do next?

Many Thanks,

Karim
By Dominic
#17082
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.

Regards,

Dominic
By karim
#17105
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.

Has anyone at sparkfun played with these units?

Any further advice is most welcome.

Thanks,

Karim
By TommyBurger
#17121
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 still don't have it working with a LPC-2106
By gogon
#17208
Sorry I'm newbie here.

I want to know does olimex USB JTAG can use with OCDemon Flash memory Programmer 2.5.6?

Thanks
By karim
#17694
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?

Anyhow, many thanks to Dominic, Tommy & Olimex.

Karim
By mifi
#17699
Hello Karim,

you can try the version r88 of OpenOCD, this was working with
the ARM-USB-OCD and an eval board from Olimex too.
I tested it with a LPC-E2294.

A windows version of r88 of OpenOCD can be found here:

http://www.yagarto.de/howto/openocd/index.html

Best regards,

Michael
By karim
#17768
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:

http://openfacts.berlios.de/index-en.ph ... ng_OpenOCD

I can't find the right options for configure. I deduced I needed to generate the makefiles with:

./configure --enable-ft2232_ftd2xx --with-ftd2xx=C:/GCCFD/ARM-JTAG-OCD

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.

Any ideas? I'm a newbie to the gnu build process.

Thanks,

Karim
By Martin Ludwig
#17776
Hello Karim,

seems i run into the same problem.

i must use following path

--with-ftd2xx=/cygdrive/c/openocd/ftdi/

the windows path for this is c:\openocd\ftdi - there i´ve put the driver-files.

maybe it helps.

Martin
By mifi
#17782
Hello Karim,

for the configuration file, take a look here:

http://www.yagarto.de/howto/openocd/index.html

Here you will find a section How to configure OpenOCD?
where you can find some cfg files too.

Sorry, I have forgotten to add the ARM-USB-OCD config
files to the installer :oops: Will be done by the next release.

Yes for the ARM-USB-OCD, you must use:

#interface
interface ft2232
ft2232_device_desc "Olimex OpenOCD JTAG A"
ft2232_layout "olimex-jtag"
ft2232_vid_pid 0x15BA 0x0003
jtag_speed 2

>should I be able to use the yagarto build of openocd with
>the cygwin arm gcc toolchain?

Yes this should work too, it is independent, and you can use
the toolchain from:
WinARM, GNUARM, sdk4arm, YAGARTO, and some other.
Sorry if I forget to mention some toolchains, this is only
a short list.

Best regards,

Michael
By karim
#17797
<chuckles/>

Thanks Martin - I was indeed using the windows absolute path instead of the cygwin absolute. This worked for me:

./configure --enable-ft2232_ftd2xx --with-ftd2xx=/cygdrive/c/gccfd/ARM-JTAG-OCD

then the make was a piece of cake and the result works just like the yagarto build. Onward...

Kind regards,

Karim