Hi again Mark.
Here’s what I’m using in my latest tutorial revision (out in a few days).
OpenOCD configuration file for Olimex ARM-USB-OCD
#define our ports
telnet_port 4444
gdb_port 3333
#commands specific to the Amontec JTAGKey
interface ft2232
ft2232_device_desc “Amontec JTAGkey A”
ft2232_layout jtagkey
ft2232_vid_pid 0x0403 0xcff8
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 script.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
script.ocd file required by OpenOCD for flash programming (put in Eclipse project)
wait_halt
armv4_5 core_state arm
mww 0xffffff60 0x00320100
mww 0xfffffd44 0xa0008000
mww 0xfffffc20 0xa0000601
wait 100
mww 0xfffffc2c 0x00480a0e
wait 200
mww 0xfffffc30 0x7
wait 100
mww 0xfffffd08 0xa5000401
flash write 0 main.bin 0x0
reset
shutdown
Auxillary target in Makefile to program flash
**********************************************************************************************
FLASH PROGRAMMING
Alternate make target for flash programming only
You must create a special Eclipse make target (program) to run this part of the makefile
(Project → Create Make Target… then set the Target Name and Make Target to “program”)
OpenOCD is run in “batch” mode with a special configuration file and a script file containing
the flash commands. When flash programming completes, OpenOCD terminates.
Note that the script file of flash commands (script.ocd) is part of the project
Programmers: Martin Thomas, Joseph M Dupre, James P Lynch
**********************************************************************************************
specify output filename here (must be *.bin file)
TARGET = main.bin
specify the directory where openocd executable resides (openocd-ftd2xx.exe or openocd-pp.exe)
OPENOCD_DIR = 'c:\Program Files\openocd-2007re141\bin'
specify OpenOCD executable (pp is for the wiggler, ftd2xx is for the USB debuggers)
#OPENOCD = $(OPENOCD_DIR)openocd-pp.exe
OPENOCD = $(OPENOCD_DIR)openocd-ftd2xx.exe
specify OpenOCD configuration file (pick the one for your device)
#OPENOCD_CFG = $(OPENOCD_DIR)at91sam7s256-wiggler-flash-program.cfg
#OPENOCD_CFG = $(OPENOCD_DIR)at91sam7s256-jtagkey-flash-program.cfg
OPENOCD_CFG = $(OPENOCD_DIR)at91sam7s256-armusbocd-flash-program.cfg
program the AT91SAM7S256 internal flash memory
program: $(TARGET)
@echo “Flash Programming with OpenOCD…”
$(OPENOCD) -f $(OPENOCD_CFG)
@echo “Flash Programming Finished.”
You may notice that this time, I’ve put the OpenOCD script file right into the Eclipse project - this simplifies the alternate target in the makefile.
Your configuration file seems to have a mix up in it - there’s some Amontec instructions mixed in with the Olimex stuff. Give my version a whirl. The script file has register settings to set the AT91SAM7256 clocks to full speed. I would have commented them more, but OpenOCD still trips up on comments put in the GDB command stream.
Cheers,
Jim Lynch