cfg: Fix Kinetis kwikstik/kx config
[openocd.git] / tcl / target / fm3.cfg
blobe2d78d1e5563b84e4090c54b7f87daa8864c2e0a
1 # MB9BF506
2 # Fujitsu Cortex-M3 with 512kB Flash and 64kB RAM
4 source [find target/swj-dp.tcl]
6 if { [info exists CHIPNAME] } {
7         set _CHIPNAME $CHIPNAME
8 } else {
9         set _CHIPNAME mb9bfxx6
12 if { [info exists ENDIAN] } {
13         set _ENDIAN $ENDIAN
14 } else {
15         set _ENDIAN little
18 if { [info exists CPUTAPID] } {
19         set _CPUTAPID $CPUTAPID
20 } else {
21         set _CPUTAPID 0x4ba00477
24 # delays on reset lines
25 adapter_nsrst_delay 100
26 if {[using_jtag]} {
27    jtag_ntrst_delay 100
30 # Fujitsu cortex-M3 reset configuration
31 reset_config trst_only
33 swj_newdap $_CHIPNAME cpu -irlen 4 -ircapture 0x1 -irmask 0xf -expected-id $_CPUTAPID
35 set _TARGETNAME $_CHIPNAME.cpu
36 target create $_TARGETNAME cortex_m -endian $_ENDIAN -chain-position $_TARGETNAME
38 # MB9BF506 has 64kB of SRAM on its main system bus 
39 $_TARGETNAME configure -work-area-phys 0x1FFF8000 -work-area-size 0x10000 -work-area-backup 0
41 # MB9BF506 has 512kB internal FLASH 
43 set _FLASHNAME $_CHIPNAME.flash
44 flash bank $_FLASHNAME fm3 0 0 0 0 $_TARGETNAME
46 # 4MHz / 6 = 666kHz, so use 500
47 adapter_khz 500
49 if {![using_hla]} {
50    # if srst is not fitted use SYSRESETREQ to
51    # perform a soft reset
52    cortex_m reset_config sysresetreq