6f939b125e1555f03ff63a65d5ef8e9b71dacca7
[bertos.git] / bertos / cpu / arm / scripts / openocd-0.2.0_at91sam7_rom_flash.cfg
1 # Change the default telnet port...
2 telnet_port 4444
3
4 # Port for TCL connection.
5 tcl_port 6666
6
7 # GDB connects here
8 gdb_port 3333
9
10 interface ft2232
11 ft2232_device_desc "Amontec JTAGkey"
12 ft2232_layout jtagkey
13 ft2232_vid_pid 0x0403 0xcff8
14
15
16 #use combined on interfaces or targets that can't set TRST/SRST separately
17 reset_config srst_only srst_pulls_trst
18
19 if { [info exists CHIPNAME] } { 
20    set  _CHIPNAME $CHIPNAME    
21 } else {         
22    set  _CHIPNAME sam7
23 }
24
25 if { [info exists ENDIAN] } {   
26    set  _ENDIAN $ENDIAN    
27 } else {         
28    set  _ENDIAN little
29 }
30
31 if { [info exists CPUTAPID ] } {
32    set _CPUTAPID $CPUTAPID
33 } else {
34    set _CPUTAPID 0x3f0f0f0f
35 }
36
37 jtag newtap $_CHIPNAME cpu -irlen 4 -ircapture 0x1 -irmask 0xf -expected-id $_CPUTAPID
38
39 set _TARGETNAME [format "%s.cpu" $_CHIPNAME]
40 target create $_TARGETNAME arm7tdmi -endian $_ENDIAN -chain-position $_TARGETNAME -variant arm7tdmi
41
42 $_TARGETNAME configure -event reset-start "script at91sam7_write_to_flash.script"
43
44 $_TARGETNAME configure -event reset-end "shutdown"
45
46 $_TARGETNAME configure -work-area-virt 0 -work-area-phys 0x00200000 -work-area-size 0x4000 -work-area-backup 0
47
48 #flash bank <driver> <base> <size> <chip_width> <bus_width>
49 flash bank at91sam7 0 0 0 0 0
50
51 init
52 reset run