OpenOCD scripts
OpenFacts, the Open Source Knowledge Database
This page will collect some script examples for different CPUs.
The configuration script can be divided in the following section:
- deamon configuration
- interface
- jtag scan chain
- target configuration
- flash configuration
Detailed information about each section can be found at OpenOCD configuration
Please indent every line of your sample script with a single space so OpenOCD will format it as script and wont try to interpret # chars and alike. Take a look at the STR710 example how to use it.
OMAP5912 Flash Debug
The following two scripts was used with an wiggler PP and and a TI OMAP5912 dual core processor (http://www.ti.com) on an OMAP5912 OSK board (http://www.spectrumdigital.com).
omap5912_osk.cfg
#daemon configuration telnet_port 4444 gdb_port 3333
#interface interface parport parport_port 0x378 parport_cable wiggler jtag_speed 0
#use combined on interfaces or targets that can't set TRST/SRST separately reset_config trst_and_srst
#jtag scan chain #format L IRC IRCM IDCODE (Length, IR Capture, IR Capture Mask, IDCODE) jtag_device 38 0x0 0x0 0x0 jtag_device 4 0x1 0x0 0xe jtag_device 8 0x0 0x0 0x0
#target configuration daemon_startup reset
#target <type> <endianness> <reset mode> <chainpos> <variant> target arm926ejs little run_and_init 1 arm926ejs target_script 0 reset omap5912_osk.init run_and_halt_time 0 30
# omap5912 lcd frame buffer as working area working_area 0 0x20000000 0x3e800 nobackup
#flash bank <driver> <base> <size> <chip_width> <bus_width> flash bank cfi 0x00000000 0x1000000 2 2 0
# For more information about the configuration files, take a look at: # http://openfacts.berlios.de/index-en.phtml?title=Open On-Chip Debugger
omap5912_osk.init
# # halt target # poll sleep 1 halt wait_halt # # disable wdt # mww 0xfffec808 0x000000f5 mww 0xfffec808 0x000000a0
mww 0xfffeb048 0x0000aaaa sleep 500 mww 0xfffeb048 0x00005555 sleep 500 # # detect flash # flash probe 0
# For more information about the configuration files, take a look at: # http://openfacts.berlios.de/index-en.phtml?title=Open On-Chip Debugger
STR710 / STR711
The following script was used with an Amontec JTAGkey and a STR710 / STR711 cpu:
#daemon configuration telnet_port 4444 gdb_port 3333
#interface interface ft2232 ft2232_device_desc "Amontec JTAGkey A" ft2232_layout jtagkey ft2232_vid_pid 0x0403 0xcff8 jtag_speed 0
#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 <endianness> <reset mode> <chainpos> <variant> target arm7tdmi little run_and_halt 0 arm7tdmi run_and_halt_time 0 30
working_area 0 0x2000C000 0x4000 nobackup
#flash bank <driver> <base> <size> <chip_width> <bus_width> flash bank str7x 0x40000000 0x00040000 0 0 STR71x 0
# For more information about the configuration files, take a look at: # http://openfacts.berlios.de/index-en.phtml?title=Open On-Chip Debugger
STR750 (different memory layout than STR71x)
The following script was used with an Amontec JTAGkey and a STR750 cpu:
#daemon configuration telnet_port 4444 gdb_port 3333
#interface interface ft2232 ft2232_device_desc "Amontec JTAGkey A" ft2232_layout jtagkey ft2232_vid_pid 0x0403 0xcff8 jtag_speed 19
#use combined on interfaces or targets that can't set TRST/SRST separately #reset_config trst_and_srst srst_pulls_trst 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
#jtag nTRST and nSRST delay jtag_nsrst_delay 500 jtag_ntrst_delay 500
#target configuration daemon_startup reset
#target <type> <startup mode> #target arm7tdmi <reset mode> <chainpos> <endianness> <variant> target arm7tdmi little run_and_halt 0 arm7tdmi run_and_halt_time 0 30
working_area 0 0x40000000 0x4000 nobackup
#flash bank <driver> <base> <size> <chip_width> <bus_width> flash bank str7x 0x20000000 0x000040000 0 0 STR75x 0
# For more information about the configuration files, take a look at: # http://openfacts.berlios.de/index-en.phtml?title=Open On-Chip Debugger
LPC2294
The following script was used with an Amontec JTAGkey and a LPC2294 cpu:
#daemon configuration telnet_port 4444 gdb_port 3333
#interface interface ft2232 ft2232_device_desc "Amontec JTAGkey A" ft2232_layout jtagkey ft2232_vid_pid 0x0403 0xcff8 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 <endianness> <reset mode> <chainpos> <variant> target arm7tdmi little run_and_halt 0 arm7tdmi-s_r4 run_and_halt_time 0 30
working_area 0 0x40000000 0x40000 nobackup
#flash configuration 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
AT91R40008
The following script was used with an Amontec JTAGkey and a AT91R40008 cpu:
#daemon configuration telnet_port 4444 gdb_port 3333
#interface interface ft2232 ft2232_device_desc "Amontec JTAGkey A" ft2232_layout jtagkey ft2232_vid_pid 0x0403 0xcff8 jtag_speed 0 jtag_nsrst_delay 200 jtag_ntrst_delay 200
#use combined on interfaces or targets that can't set TRST/SRST separately reset_config srst_only 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 <endianness> <reset mode> <chainpos> <variant> target arm7tdmi little run_and_halt 0 arm7tdmi run_and_halt_time 0 30
# For more information about the configuration files, take a look at: # http://openfacts.berlios.de/index-en.phtml?title=Open On-Chip Debugger
LPC2129 Flash Debug
The following script was used with an wiggler PP and a LPC-2129 cpu:
#daemon configuration telnet_port 4444 gdb_port 3333
#interface interface parport parport_port 0x378 parport_cable wiggler jtag_speed 0
#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 <endianness> <reset mode> <chainpos> <variant> target arm7tdmi little run_and_halt 0 arm7tdmi-s_r4 run_and_halt_time 0 30
working_area 0 0x00000000 0x400000 nobackup
#flash bank <driver> <base> <size> <chip_width> <bus_width> 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
AT91SAM7s
The following script was used with an Olimex ARM-JTAG-OCD and a AT91SAM7S64 cpu:
#daemon configuration telnet_port 4444 gdb_port 3333
#interface interface ft2232 ft2232_device_desc "Olimex OpenOCD JTAG A" ft2232_layout olimex-jtag ft2232_vid_pid 0x15BA 0x0003 jtag_speed 0 jtag_nsrst_delay 200 jtag_ntrst_delay 200
#use combined on interfaces or targets that can't set TRST/SRST separately reset_config srst_only 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 <endianness> <reset mode> <chainpos> <variant> target arm7tdmi little run_and_halt 0 arm7tdmi run_and_halt_time 0 30
# flash-options AT91 working_area 0 0x00200000 0x4000 nobackup flash bank at91sam7 0 0 0 0 0
# Information: # erase command (telnet-interface) for complete flash: # flash erase <num> 0 numlockbits-1 (can be seen from output of flash info 0) # SAM7S64 with 16 lockbits and bank 0: flash erase 0 0 15 # set/clear NVM-Bits: # at91sam7 gpnvm <num> <bit> <set|clear> # disable locking from SAM-BA: # flash protect 0 0 1 off
# For more information about the configuration files, take a look at: # http://openfacts.berlios.de/index-en.phtml?title=Open On-Chip Debugger
STR912
The following script was used with an Amontec JTAGkey and a STR912 cpu:
#daemon configuration telnet_port 4444 gdb_port 3333
#interface interface ft2232 ft2232_device_desc "Amontec JTAGkey A" ft2232_layout jtagkey jtag_speed 1
#use combined on interfaces or targets that can't set TRST/SRST separately reset_config trst_and_srst
#jtag scan chain #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 daemon_startup reset
#target <type> <startup mode> #target arm966e <endianness> <reset mode> <chainpos> <variant> target arm966e little reset_halt 1 arm966e run_and_halt_time 0 30
working_area 0 0x50000000 16384 nobackup
#flash bank <driver> <base> <size> <chip_width> <bus_width> flash bank str9x 0x00000000 0x00080000 0 0 0
# For more information about the configuration files, take a look at: # http://openfacts.berlios.de/index-en.phtml?title=Open On-Chip Debugger
STM32x
The following script was used with an Amontec JTAGkey and a STM32x cpu:
#daemon configuration telnet_port 4444 gdb_port 3333
#interface interface ft2232 ft2232_device_desc "Amontec JTAGkey A" ft2232_layout jtagkey jtag_speed 10
#use combined on interfaces or targets that can't set TRST/SRST separately reset_config trst_and_srst
#jtag scan chain #format L IRC IRCM IDCODE (Length, IR Capture, IR Capture Mask, IDCODE) jtag_device 4 0x1 0xf 0xe jtag_device 5 0x1 0x1 0x1e
#target configuration daemon_startup reset
#target <type> <startup mode> #target cortex_m3 <endianness> <reset mode> <chainpos> <variant> target cortex_m3 little run_and_halt 0 run_and_halt_time 0 30
working_area 0 0x20000000 16384 nobackup
#flash bank <driver> <base> <size> <chip_width> <bus_width> flash bank stm32x 0x08000000 0x00010000 0 0 0
# For more information about the configuration files, take a look at: # http://openfacts.berlios.de/index-en.phtml?title=Open On-Chip Debugger
XSCALE IXP42x
The following script was used with an Amontec JTAGkey-Tiny and a xscale ixp42x cpu:
#daemon configuration telnet_port 4444 gdb_port 3333
#interface interface ft2232 ft2232_device_desc "Amontec JTAGkey A" ft2232_layout jtagkey ft2232_vid_pid 0x0403 0xcff8 jtag_speed 0 jtag_nsrst_delay 200 jtag_ntrst_delay 200
#use combined on interfaces or targets that can't set TRST/SRST separately reset_config srst_only srst_pulls_trst
#jtag scan chain #format L IRC IRCM IDCODE (Length, IR Capture, IR Capture Mask, IDCODE) jtag_device 7 0x1 0x7f 0x7e
#target configuration daemon_startup reset
#target <type> <startup mode> #target arm7tdmi <reset mode> <chainpos> <endianness> <variant> target xscale big run_and_halt 0 IXP42x run_and_halt_time 0 30
# For more information about the configuration files, take a look at: # http://openfacts.berlios.de/index-en.phtml?title=Open On-Chip Debugger
Cirrus Logic EP9301
The following script was used with FT2232 based JTAG interfaces and a Cirrus Logic EP9301 processor on an Olimex CS-E9301 board.
#daemon configuration telnet_port 4444 gdb_port 3333
#interface interface ft2232
#Olimex ARM-USB-OCD #ft2232_device_desc "Olimex OpenOCD JTAG" #ft2232_layout olimex-jtag #ft2232_vid_pid 0x15ba 0x0003
#Amontec JTAGkey (and JTAGkey-Tiny) #Serial is only necessary if more than one JTAGkey is connected ft2232_device_desc "Amontec JTAGkey A" #ft2232_serial AMTJKV31 #ft2232_serial T1P3S2W8 ft2232_layout jtagkey ft2232_vid_pid 0x0403 0xcff8
#wiggler/parallel port interface #interface parport #parport_port 0x378 #parport_cable wiggler #jtag_speed 0
jtag_speed 1 reset_config trst_and_srst
#jtag scan chain #format L IRC IRCM IDCODE (Length, IR Capture, IR Capture Mask, IDCODE) jtag_device 4 0x1 0xf 0xe
jtag_nsrst_delay 100 jtag_ntrst_delay 100
#target configuration daemon_startup attach
#target <type> <endianess> <reset mode> target arm920t little reset_halt 0 working_area 0 0x80014000 0x1000 backup
#flash configuration #flash bank <driver> <base> <size> <chip_width> <bus_width> [driver_options ...] flash bank cfi 0x60000000 0x1000000 2 2 0
Hilscher netX 100 / 500
The following script was used with an Amontec JTAGkey and a Hilscher netX 500 cpu:
#daemon configuration telnet_port 4444 gdb_port 3333
#interface interface ft2232 ft2232_device_desc "Amontec JTAGkey A" ft2232_layout jtagkey ft2232_vid_pid 0x0403 0xcff8 jtag_speed 5
#use combined on interfaces or targets that can't set TRST/SRST separately reset_config trst_and_srst
#jtag scan chain #format L IRC IRCM IDCODE (Length, IR Capture, IR Capture Mask, IDCODE) jtag_device 4 0x1 0xf 0xe
jtag_nsrst_delay 100 jtag_ntrst_delay 100
#target configuration daemon_startup reset
#target <type> <endianness> <startup mode> <chainpos> <variant> target arm926ejs little run_and_halt 0 arm926ejs run_and_halt_time 0 500
Marvell/Intel PXA270
# config for Intel PXA270 # not, as of 2007-06-22, openocd only works with the # libftd2xx library from ftdi. libftdi does not work.
telnet_port 3333 gdb_port 4444
interface ft2232 ft2232_layout olimex-jtag ft2232_vid_pid 0x15BA 0x0003 ft2232_device_desc "Olimex OpenOCD JTAG" jtag_speed 0 # set jtag_nsrst_delay to the delay introduced by your reset circuit # the rest of the needed delays are built into the openocd program jtag_nsrst_delay 260 # set the jtag_ntrst_delay to the delay introduced by a reset circuit # the rest of the needed delays are built into the openocd program jtag_ntrst_delay 0
#use combined on interfaces or targets that can't set TRST/SRST separately reset_config trst_and_srst separate
#jtag scan chain #format L IRC IRCM IDCODE (Length, IR Capture, IR Capture Mask, IDCODE) jtag_device 7 0x1 0x7f 0x7e
#target configuration daemon_startup reset
target xscale little reset_halt 0 pxa27x
# maps to PXA internal RAM. If you are using a PXA255 # you must initialize SDRAM or leave this option off working_area 0 0x5c000000 0x10000 nobackup
run_and_halt_time 0 30
#flash bank <driver> <base> <size> <chip_width> <bus_width> # works for P30 flash flash bank cfi 0x00000000 0x1000000 2 4 0
![[Main Page]](http://openfacts.berlios.de/images/berliOS_small_logo.png)