Building and using OpenOCD for STR9-comstick

I am trying to use OpenOCD to program a hitex STR9-comStick from a GNU/Linux computer. I am having difficulty in getting everything to work, and I am not sure if the problem is in my building of the openOCD program, or the openocd.cfg scripts I have tried. Previously, I have used openOCD to program the STR9-comStick, but someone else had set up the system. I now have to figure out what they did, and they are not available to help.

First, I tried the version of the program available from my distribution (Linux Mint 6). This was openOCD version r655. I tried openocd.cfg scripts from the following sites to gain access to the commStick, but with no success.

http://eleceng.dit.ie/frank/arm/comstick/index.html

http://www.eluaproject.net/en_tut_openo … #str9files

https://lists.berlios.de/pipermail/open … chment.obj

I also tried the script available from the openOCD repository version 0.4.0, file tcl/board/hitex_str9-comstick.cfg. This also did not work.

Next, I considered that the older version of openOCD did not support the STR9-comStick, so I downloaded the latest version, 0.4.0. Before compiling openOCD, I compiled and installed libftdi-0.18, confuse-2.5, and ftdi_eeprom-0.3. I then compiled and installed openOCD after configuring with the --enable-ft2232-libftdi option. The program compiled without error.

With openOCD v0.4.0, using the script provided in the repository tcl/board/hitex_str9-comstick.cfg, I get the following output when the comStick is plugged in:

sudo openocd -f hitex_str9-comstick.cfg

Open On-Chip Debugger 0.4.0 (2010-10-15-13:29)

Licensed under GNU GPL v2

For bug reports, read

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

3000 kHz

jtag_nsrst_delay: 100

jtag_ntrst_delay: 100

trst_and_srst separate srst_gates_jtag trst_push_pull srst_open_drain

Warn : str912.flash: nonstandard IR mask

Warn : str912.bs: nonstandard IR mask

Warn : use ‘str912.cpu’ as target identifier, not ‘0’

Warn : use ‘str912.cpu’ as target identifier, not ‘0’

Info : clock speed 3000 kHz

Info : TAP str912.flash does not have IDCODE

Warn : JTAG tap: str912.flash UNEXPECTED: 0x00000000 (mfg: 0x000, part: 0x0000, ver: 0x0)

Error: JTAG tap: str912.flash expected 1 of 1: 0x04570041 (mfg: 0x020, part: 0x4570, ver: 0x0)

Info : JTAG tap: str912.cpu tap/device found: 0x85fd047d (mfg: 0x23e, part: 0x5fd0, ver: 0x8)

Warn : JTAG tap: str912.cpu UNEXPECTED: 0x85fd047d (mfg: 0x23e, part: 0x5fd0, ver: 0x8)

Error: JTAG tap: str912.cpu expected 1 of 1: 0x25966041 (mfg: 0x020, part: 0x5966, ver: 0x2)

Info : JTAG tap: str912.bs tap/device found: 0xffffffff (mfg: 0x7ff, part: 0xffff, ver: 0xf)

Warn : JTAG tap: str912.bs UNEXPECTED: 0xffffffff (mfg: 0x7ff, part: 0xffff, ver: 0xf)

Error: JTAG tap: str912.bs expected 1 of 2: 0x1457f041 (mfg: 0x020, part: 0x457f, ver: 0x1)

Error: JTAG tap: str912.bs expected 2 of 2: 0x2457f041 (mfg: 0x020, part: 0x457f, ver: 0x2)

Error: Trying to use configured scan chain anyway…

Error: str912.cpu: IR capture error; saw 0x0f not 0x01

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 know that the comStick is recognized, as it comes up when I run lsusb:

lsusb | grep Hitex

Bus 005 Device 019: ID 0640:002c Hitex Development Tools

lsusb -v | grep iProduct

iProduct 2 STR9-comStick

I notice that a lot of scripts I tried with the old openOCD version no longer worked with v0.4.0 due to a no longer supported jtag_speed command.

If it is helpful, when I plug in the comStick in, the orange led is off. Once I try and run openOCD, the orange led blinks continuously.

Does anyone have advice to help me get openOCD working to program the STR9-comStick? Maybe there is something simple that I am missing.

Thank you!

I seem to have figured out part of my problem. I am using openOCD v0.4.0.

I can get the program to recognize and control the comStick sometimes, but not most of the times. For example, using the configuration files that come along with openOCD, I can get the following:

openocd openocd-0.4.0/tcl/interface/hitex_str9-comstick.cfg -f openocd-0.4.0/tcl/board/hitex_str9-comstick.cfg

Open On-Chip Debugger 0.4.0 (2010-10-15-13:29)

Licensed under GNU GPL v2

For bug reports, read

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

Warn : Interface already configured, ignoring

3000 kHz

jtag_nsrst_delay: 100

jtag_ntrst_delay: 100

trst_and_srst separate srst_gates_jtag trst_push_pull srst_open_drain

Warn : str912.flash: nonstandard IR mask

Warn : str912.bs: nonstandard IR mask

Warn : use ‘str912.cpu’ as target identifier, not ‘0’

Warn : use ‘str912.cpu’ as target identifier, not ‘0’

Info : clock speed 3000 kHz

Info : JTAG tap: str912.flash tap/device found: 0x04570041 (mfg: 0x020, part: 0x4570, ver: 0x0)

Info : JTAG tap: str912.cpu tap/device found: 0x25966041 (mfg: 0x020, part: 0x5966, ver: 0x2)

Info : JTAG tap: str912.bs tap/device found: 0x2457f041 (mfg: 0x020, part: 0x457f, ver: 0x2)

Info : Embedded ICE version 6

Info : str912.cpu: hardware has 2 breakpoint/watchpoint units

This, I think is successful. However, if I unplug the device and plug it back in, to reproduce my results, it more often that not fails, even when I give the comStick a lot of time to rest first before trying.

openocd openocd-0.4.0/tcl/interface/hitex_str9-comstick.cfg -f openocd-0.4.0/tcl/board/hitex_str9-comstick.cfg

Open On-Chip Debugger 0.4.0 (2010-10-15-13:29)

Licensed under GNU GPL v2

For bug reports, read

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

Warn : Interface already configured, ignoring

3000 kHz

jtag_nsrst_delay: 100

jtag_ntrst_delay: 100

trst_and_srst separate srst_gates_jtag trst_push_pull srst_open_drain

Warn : str912.flash: nonstandard IR mask

Warn : str912.bs: nonstandard IR mask

Warn : use ‘str912.cpu’ as target identifier, not ‘0’

Warn : use ‘str912.cpu’ as target identifier, not ‘0’

Info : clock speed 3000 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 try to run the ‘jtag_init’ command like it asks, but it does not fix anything:

openocd -f openocd-0.4.0/tcl/interface/hitex_str9-comstick.cfg -f openocd-0.4.0/tcl/board/hitex_str9-comstick.cfg -c jtag_init

Open On-Chip Debugger 0.4.0 (2010-10-15-13:29)

Licensed under GNU GPL v2

For bug reports, read

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

Warn : Interface already configured, ignoring

3000 kHz

jtag_nsrst_delay: 100

jtag_ntrst_delay: 100

trst_and_srst separate srst_gates_jtag trst_push_pull srst_open_drain

Warn : str912.flash: nonstandard IR mask

Warn : str912.bs: nonstandard IR mask

Warn : use ‘str912.cpu’ as target identifier, not ‘0’

Warn : use ‘str912.cpu’ as target identifier, not ‘0’

openocd: core.c:338: jtag_checks: Assertion `jtag_trst == 0’ failed.

Aborted

What is going on? What am I doing wrong? Any help or guidance would be appreciated. Thanks!