OpenOCD questions [newbie]

Hi all,

I just noticed that there is the OpenOCD group on SFE, I’ve been posting questions on other SFE groups!

(sorry all :oops: )

Well, let me get right to it!

I’m trying to flash my AT91SAM7S256 (Olimex) using their ARM-USB-OCD. I have finally made a somewhat stable environment using the Yagarto toolchain. I can compile etc.

Now when I try to flash the chip, I get an error about the “lock bit” is set etc. So I telnet into it

telnet localhost 4444

and I want (notice the want!), to issue this command

flash info 0

I get the error

command info not found

I can do some commands, version, help, but not the flash ones! aaah!

Any thoughts?!

~Kam (^8*

You need a “flash …” line in your .cfg file, otherwise the flash commands are disabled. See this page for example configs, including one for the at91sam7:

http://openfacts.berlios.de/index-en.ph … CD_scripts

Regards,

Dominic

Hi all,

It’s been a long morning already :frowning:

Well, I restored my machine last night after a major dump (love windows), and I’m reinstalling the Yagardo toolchain.

BTW, the Yagardo thats on the ARM-USB-OCD cdrom is the same as whats on the website, just a FYI, at least on 01/19/07 or 19/01/07!

SoI reinstalled, and am trying to just get back to where I was, and already errors!

When I run OpenOCD from Eclipse I get this:

Info: openocd.c:82 main(): Open On-Chip Debugger (2006-10-12 18:00 CEST)

Warning: arm7_9_common.c:683 arm7_9_assert_reset(): srst resets test logic, too

When I compile, it compiles just fine (LED Blink example in tutorial)

When I try to “program” I get this

make -k program

Preparing OpenOCD script…

Flash Programming with OpenOCD…

'c:\Program Files\openocd-2006re115\bin'openocd-ftd2xx.exe -f 'c:\Program Files\openocd-2006re115\bin'at91sam7s256-armusbocd-flash-program.cfg

Info: openocd.c:82 main(): Open On-Chip Debugger (2006-10-12 18:00 CEST)

Error: ft2232.c:1033 ft2232_init(): unable to open ftdi device: 1

make: *** [program] Error 1

I have NO idea ( :? ) what I did now and what I did last night differs!

Here is my cfg file

#define our ports

telnet_port 4444

gdb_port 3333

#commands specific to the Amontec JTAGKey

interface ft2232

ft2232_device_desc “Olimex OpenOCD JTAG A”

ft2232_layout “olimex-jtag”

ft2232_vid_pid 0x15BA 0x0003

jtag_speed 2

jtag_nsrst_delay 200

jtag_ntrst_delay 200

#reset_config [combination] [trst_type] [srst_type]

reset_config srst_only srst_pulls_trst

#jtag_device

jtag_device 4 0x1 0xf 0xe

#daemon_startup <‘attach’|‘reset’>

daemon_startup reset

#target <reset_mode> <jtag#> [variant]

target arm7tdmi little run_and_init 0 arm7tdmi_r4

#run_and_halt_time <target#> <time_in_ms>

run_and_halt_time 0 30

commands below are specific to AT91sam7 Flash Programming

---------------------------------------------------------

#target_script specifies the flash programming script file

target_script 0 reset c:\temp\temp.ocd

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

working_area 0 0x40000000 0x4000 nobackup

#flash bank at91sam7 0 0 0 0 <target#>

flash bank at91sam7 0 0 0 0 0

Thoughts/etc.

#1. Now when I plug in my ARM-USB-OCD the light on the dongle turns GREEN, when I start OpenOCD, it turns YELLOW.

#2. I’m applying 5v to the Olimex board from dongle

~Kam (^8*

Hello Kam,

BTW, the Yagardo thats on the ARM-USB-OCD cdrom is the same as whats on the website

Do you mean that the compiler on the ARM-USB-OCD cdrom is the same

as on the www.yagarto.de page? Does it comes with the same installer?

Best regards,

Michael

Probably you are tryng to run two simultaneous instances of OpenOCD.

If you run OpenOCD from Eclipse and then tries to program from the makefile without shutting down the first instance of OpenOCD then the JTAG dongle is already occupied by the first instance and the one started by the makefile cannot open the JTAG dongle giving the error "unable to open ftdi device: 1 "

Running a OpenOcd programming script from make called from Eclipse is not a good idea. It is better to build all relevant files with make and then use the script command to run the programming script, something like:

monitor script programflash.scr

Regards,

Magnus

Hi all!!!

Success! :smiley: :smiley: :smiley: :smiley: :smiley: :smiley: :smiley: :smiley: :smiley: :smiley: :smiley: :smiley:

I reinstalled EVERYTHING (Yagardo), removed the locked bits using the 2 lines on the temp.ocd file as listed on page 80 of the James Lynch masterpiece doc!

I did NOTHING different!

I can make LED’s blink!

Thank you ALL!

If any of you are near Santa Cruz, CA., let me know, and I’ll buy you a beer or 3 (or soda/tea/coffee)!!!

thank you all again.

~Kam (^8*