4 if { [info exists CHIPNAME] } {
5 set _CHIPNAME $CHIPNAME
10 if { [info exists ENDIAN] } {
16 # Work-area is a space in RAM used for flash programming
18 if { [info exists WORKAREASIZE] } {
19 set _WORKAREASIZE $WORKAREASIZE
21 set _WORKAREASIZE 0x4000
24 # JTAG speed should be <= F_CPU/6. F_CPU after reset is 8MHz, so use F_JTAG = 1MHz
26 # use this when breaking in while the device is in reset
33 if { [info exists CPUTAPID ] } {
34 set _CPUTAPID $CPUTAPID
37 set _CPUTAPID 0x4ba00477
39 jtag newtap $_CHIPNAME cpu -irlen 4 -ircapture 0x1 -irmask 0xf -expected-id $_CPUTAPID
41 if { [info exists BSTAPID ] } {
44 set _BSTAPID 0x06411041
46 jtag newtap $_CHIPNAME bs -irlen 5 -expected-id $_BSTAPID
48 set _TARGETNAME $_CHIPNAME.cpu
49 target create $_TARGETNAME cortex_m3 -endian $_ENDIAN -chain-position $_TARGETNAME
51 $_TARGETNAME configure -work-area-phys 0x20000000 -work-area-size $_WORKAREASIZE -work-area-backup 0
53 # if srst is not fitted use SYSRESETREQ to
54 # perform a soft reset
55 # cortex_m3 reset_config sysresetreq
57 set _FLASHNAME $_CHIPNAME.flash
58 flash bank $_FLASHNAME stm32f2xxx 0 0 0 0 $_TARGETNAME
60 # For more information about the configuration files, take a look at: