fix coverity CID 349306 - resource leak
[RRG-proxmark3.git] / tools / jtag_openocd / board-at91sam7s.cfg
blob9f570632abcd74418deb4d13d3077e91fd34a8a1
1 ## Chipset configuration section
2 # use combined on interfaces or targets that can't set TRST/SRST separately
3 reset_config srst_only srst_pulls_trst
5 jtag newtap sam7x cpu -irlen 4 -ircapture 0x1 -irmask 0xf -expected-id 0x3f0f0f0f
7 target create sam7x.cpu arm7tdmi -endian little -chain-position sam7x.cpu
9 sam7x.cpu configure -event reset-init {
10     soft_reset_halt
11     mww 0xfffffd00 0xa5000004   # RSTC_CR: Reset peripherals
12     mww 0xfffffd44 0x00008000   # WDT_MR: disable watchdog
13     mww 0xfffffd08 0xa5000001   # RSTC_MR enable user reset
14     mww 0xfffffc20 0x00005001   # CKGR_MOR : enable the main oscillator
15     sleep 10
16     mww 0xfffffc2c 0x000b1c02   # CKGR_PLLR: 16MHz * 12/2 = 96MHz
17     sleep 10
18     mww 0xfffffc30 0x00000007   # PMC_MCKR : MCK = PLL / 2 = 48 MHz
19     sleep 10
20     mww 0xffffff60 0x00480100   # MC_FMR: flash mode (FWS=1,FMCN=72)
21     sleep 100
24 gdb_memory_map enable
25 #gdb_breakpoint_override hard
26 #armv4_5 core_state arm
28 sam7x.cpu configure -work-area-virt 0 -work-area-phys 0x00200000 -work-area-size 0x10000 -work-area-backup 0
29 flash bank sam7x.flash.0 at91sam7 0 0 0 0 sam7x.cpu 0 0 0 0 0 0 0 18432
30 flash bank sam7x.flash.1 at91sam7 0 0 0 0 sam7x.cpu 1 0 0 0 0 0 0 18432
31 transport select jtag
32 # Since some 0.10.0 versions, "adapter_khz" is deprecated in favor of "adapter speed" but there are also some 0.10.0 not recognizing "adapter speed" so we'll stick to "adapter_khz" for now...
33 # adapter speed 1000
34 adapter_khz 1000