544cff9d6a088e5a53f6768149543ca8efea33eb
[fw/openocd] / tcl / target / fm3.cfg
1 # MB9BF506
2 # Fujitsu Cortex-M3 with 512kB Flash and 64kB RAM
3
4 source [find target/swj-dp.tcl]
5
6 if { [info exists CHIPNAME] } {
7         set _CHIPNAME $CHIPNAME
8 } else {
9         set _CHIPNAME mb9bfxx6
10 }
11
12 if { [info exists ENDIAN] } {
13         set _ENDIAN $ENDIAN
14 } else {
15         set _ENDIAN little
16 }
17
18 if { [info exists CPUTAPID] } {
19         set _CPUTAPID $CPUTAPID
20 } else {
21         set _CPUTAPID 0x4ba00477
22 }
23
24 # delays on reset lines
25 adapter srst delay 100
26 if {[using_jtag]} {
27    jtag_ntrst_delay 100
28 }
29
30 # Fujitsu Cortex-M3 reset configuration
31 reset_config trst_only
32
33 swj_newdap $_CHIPNAME cpu -irlen 4 -ircapture 0x1 -irmask 0xf -expected-id $_CPUTAPID
34 dap create $_CHIPNAME.dap -chain-position $_CHIPNAME.cpu
35
36 set _TARGETNAME $_CHIPNAME.cpu
37 target create $_TARGETNAME cortex_m -endian $_ENDIAN -dap $_CHIPNAME.dap
38
39 # MB9BF506 has 64kB of SRAM on its main system bus
40 $_TARGETNAME configure -work-area-phys 0x1FFF8000 -work-area-size 0x10000 -work-area-backup 0
41
42 # MB9BF506 has 512kB internal FLASH
43
44 set _FLASHNAME $_CHIPNAME.flash
45 flash bank $_FLASHNAME fm3 0 0 0 0 $_TARGETNAME
46
47 # 4MHz / 6 = 666kHz, so use 500
48 adapter speed 500
49
50 if {![using_hla]} {
51    # if srst is not fitted use SYSRESETREQ to
52    # perform a soft reset
53    cortex_m reset_config sysresetreq
54 }