STR9 & ARM-USB-OCD

Hi,

does anyone have complete script for flashing/debugging str9 via arm-usb-ocd?

Reg

Use my str9 script here:

http://www.sparkfun.com/cgi-bin/phpbb/v … php?t=4812

just changing the interface and jtag speed:

interface ft2232

ft2232_device_desc “Olimex OpenOCD JTAG A”

ft2232_layout olimex-jtag

jtag_speed 1

Regards

Spen

thanks ntfreak!

for all newbies like me :slight_smile: here is config file which works with STR-E912 board and ARM-USB-OCD!

note: don’t forget to remove jumper RST-TRST from STR-E912 board!

if you have other board check for trst and srst signals on your board and your reset_config parameter!

file arm-usb-ocd_str9.cfg (thanks to ntfreak):

debug options

##debug 3

daemon configuration

telnet_port 4000

gdb_port 2000

interface ft2232

ft2232_device_desc “Olimex OpenOCD JTAG A”

ft2232_layout olimex-jtag

jtag_speed 1

use combined on interfaces or targets that can’t set TRST/SRST separately

# !!!For Olimex STR-E912 board you must remove jumper RST-TRST!!!

reset_config trst_and_srst

jtag scan chain (first device being the one closest to TDO)

format L IRC IRCM IDCODE (Length, IR Capture, IR Capture Mask, IDCODE)

jtag_device 8 0x1 0x1 0xfe

jtag_device 4 0x1 0xf 0xe

jtag_device 5 0x1 0x1 0x1e

target configuration

##target arm966e little run_and_halt 1 arm966e

target arm966e little reset_halt 1 arm966e

reset or attach

daemon_startup reset

##run_and_halt_time 0 0

working_area <target#> <‘backup’|‘nobackup’>

working_area 0 0x50000000 16384 nobackup

flash stuff

flash bank str9x 0x00000000 0x00080000 0 0 0


first run deamon with this config file:

openocd-ftd2xx –f arm-usb-ocd_str9.cfg

then it is possible to for example flash STR9 device via telnet at port 4000:

telnet localhost 4000

commands for flashing (for details look at http://openfacts.berlios.de/index-en.ph … D_commands or at http://www.fh-augsburg.de/~hhoegl/proj/ … ickref.pdf):

str9x flash_config 4 2 0 0x80000

flash protect 0 0 11 off

flash erase 0 0 2

flash write 0 lcddemo.bin 0x0

Hi,

I have done everything that has been mentioned in this thread but I am

unable to get this setup completely working. My openocd can validate the

JTAG chain and starts up nicely. I can connect using telnet and get help and

do only CPU specific commands. For all the other commands like dumping

memory or when i try to program the flash it gives me an error saying

the target must be halted before this operation can be performed.

When I try to halt the target it just times out :frowning: I have tried to use the

multi-ICE+ AXD 1.2 combination with an In Circuit Emulator also but the

same thing happens. Multi-ICE is able to validate the JTAG chain and is

able to see the three devices but AXD 1.2 fails to halt the target.

Can somebody please help me with this.

tomhawk

PS: I have already removed the TRST_RST jumper.

Hi,

could you please tell us a bit more about your target board, your JTAG interface and the version of OpenOCD you’re using?

You should always use the latest OpenOCD version available, either compiled yourself from SVN or using the binaries provided by www.yagarto.de.

Regards,

Dominic

Hi Dominic,

Thanks for the reply.

The target board is Olimex STR-E912 that has a STR912(ARM966) on board.

I got a package on a cd from olimex when I bought the Olimex

ARM-USB-OCD from them. It installed openocd version r115, the FTDI driver and eclipse on my machine. I assumed this configuration would work as

everything was coming in a package from them.

I can try the new version of openocd. I will let you know if that works.

Thanks,

tomhawk

Hi,

if it doesn’t work send me a log file (run with -d -l ) to Dominic Rath gmx de.

Regards,

Dominic

Hi Tom,

a few things for you to try:

  • increase the jtag_speed divisor (try 10, and if it works, reduce it gradually)

  • change daemon_startup to “attach” instead of “reset”

  • change “reset_halt” in the target line to “run_and_halt”

It would be best if you could try each change individually.

Regards,

Dominic

Hi Tom,

I tried each of them individually but none of them worked.

Thanks,

Tom

Hi Tom,

could you try reading the “comms_ctrl” register:

(at the telnet prompt, with “daemon_startup” set to “attach”)

reg comms_ctrl

and paste the result.

Regards,

Dominic

The comms_ctrl value is

reg comms_ctrl

comms_ctrl (/32): 0x60000000

Thanks,

Tom Hawk

That value is ok, the mystery deepens.

A log file would be the next step.

Spen

Hello Spen,

I’ve forwarded you the log that Tom sent me yesterday.

Regards,

Dominic

Hi Tom,

as Spen already said the comms_ctrl value of 0x6… (denoting EmbeddedICE Rev6) is fine - I thought/hoped that maybe there were different revisions of the STR9x using different ARM9E-S cores, but apparently your chip is exactly the same as Spen’s.

Is there already code running on your board?

If there is code, is that code working at the time you’re trying to halt it?

You could try a very slow JTAG frequency, like “jtag_speed 100”.

Regards,

Dominic

Hi guys,

I got it somewhat working with some error messages but the code is

running fine and I am able to halt the target. Here is what I did.

I changed the jtag reset to

“reset_config trst_only”

Also, I put the “trst_rst” jumper back on. here is the output of the

openocd when I used that configuration.

Info: openocd.c:84 main(): Open On-Chip Debugger (2006-01-26 13:30 CET)

Error: jtag.c:832 jtag_add_reset(): requested nSRST assertion, but the current configuration doesn

't support this

Warning: arm966e.c:105 arm966e_assert_reset(): can’t assert srst

Warning: arm7_9_common.c:848 arm7_9_halt(): target was in unknown state when halt was requested

Warning: arm7_9_common.c:623 arm7_9_poll(): DBGACK set while target was in unknown state. Reset or initialize target before resuming

regards,

tomhawk