From 327fafc6a22f5ff22c591c1ca345d3910022cfec Mon Sep 17 00:00:00 2001 From: Spencer Oliver Date: Wed, 4 Jan 2012 21:48:21 +0000 Subject: [PATCH] cfg: add stlink pseudo stm32 targets Change-Id: I71253c2090162b1214bbbb37396735bb9128f920 Signed-off-by: Spencer Oliver Reviewed-on: http://openocd.zylin.com/334 Tested-by: jenkins Reviewed-by: Freddie Chopin --- tcl/board/stm32f4discovery.cfg | 6 +++ .../{stm32f2x_stlink.cfg => stm32_stlink.cfg} | 15 ++++---- tcl/target/stm32f1x_stlink.cfg | 12 ++++++ tcl/target/stm32f2x_stlink.cfg | 44 ++++++---------------- tcl/target/stm32f4x_stlink.cfg | 13 +++++++ tcl/target/stm32lx_stlink.cfg | 12 ++++++ 6 files changed, 62 insertions(+), 40 deletions(-) create mode 100644 tcl/board/stm32f4discovery.cfg copy tcl/target/{stm32f2x_stlink.cfg => stm32_stlink.cfg} (73%) create mode 100644 tcl/target/stm32f1x_stlink.cfg rewrite tcl/target/stm32f2x_stlink.cfg (94%) create mode 100644 tcl/target/stm32f4x_stlink.cfg create mode 100644 tcl/target/stm32lx_stlink.cfg diff --git a/tcl/board/stm32f4discovery.cfg b/tcl/board/stm32f4discovery.cfg new file mode 100644 index 000000000..33bcaa61c --- /dev/null +++ b/tcl/board/stm32f4discovery.cfg @@ -0,0 +1,6 @@ +# This is an STM32F4 discovery board with a single STM32F407VGT6 chip. +# http://www.st.com/internet/evalboard/product/252419.jsp + +source [find interface/stlink-usb.cfg] + +source [find target/stm32f4x_stlink.cfg] diff --git a/tcl/target/stm32f2x_stlink.cfg b/tcl/target/stm32_stlink.cfg similarity index 73% copy from tcl/target/stm32f2x_stlink.cfg copy to tcl/target/stm32_stlink.cfg index bb113e04e..7af07ce7a 100644 --- a/tcl/target/stm32f2x_stlink.cfg +++ b/tcl/target/stm32_stlink.cfg @@ -1,24 +1,26 @@ # +# stm32 stlink pseudo target # -# + if { [info exists CHIPNAME] } { set _CHIPNAME $CHIPNAME } else { - set _CHIPNAME stm32 + set _CHIPNAME stm32f1x } # Work-area is a space in RAM used for flash programming -# By default use 64kB +# By default use 16kB if { [info exists WORKAREASIZE] } { set _WORKAREASIZE $WORKAREASIZE } else { - set _WORKAREASIZE 0x10000 + set _WORKAREASIZE 0x4000 } if { [info exists CPUTAPID] } { set _CPUTAPID $CPUTAPID } else { - set _CPUTAPID 0x2ba01477 + # this is the SW-DP tap id not the jtag tap id + set _CPUTAPID 0x1ba01477 } stlink newtap $_CHIPNAME cpu -expected-id $_CPUTAPID @@ -27,6 +29,3 @@ set _TARGETNAME $_CHIPNAME.cpu target create $_TARGETNAME stm32_stlink -chain-position $_TARGETNAME $_TARGETNAME configure -work-area-phys 0x20000000 -work-area-size $_WORKAREASIZE -work-area-backup 0 - -set _FLASHNAME $_CHIPNAME.flash -flash bank $_FLASHNAME stm32f2x 0x08000000 0 0 0 $_TARGETNAME diff --git a/tcl/target/stm32f1x_stlink.cfg b/tcl/target/stm32f1x_stlink.cfg new file mode 100644 index 000000000..67dfb7bca --- /dev/null +++ b/tcl/target/stm32f1x_stlink.cfg @@ -0,0 +1,12 @@ +# +# STM32f1x stlink pseudo target +# + +set CHIPNAME stm32f1x +set CPUTAPID 0x1ba01477 +set WORKAREASIZE 0x4000 + +source [find target/stm32_stlink.cfg] + +set _FLASHNAME $_CHIPNAME.flash +flash bank $_FLASHNAME stm32f1x 0 0 0 0 $_TARGETNAME diff --git a/tcl/target/stm32f2x_stlink.cfg b/tcl/target/stm32f2x_stlink.cfg dissimilarity index 94% index bb113e04e..9c4e6fecd 100644 --- a/tcl/target/stm32f2x_stlink.cfg +++ b/tcl/target/stm32f2x_stlink.cfg @@ -1,32 +1,12 @@ -# -# -# -if { [info exists CHIPNAME] } { - set _CHIPNAME $CHIPNAME -} else { - set _CHIPNAME stm32 -} - -# Work-area is a space in RAM used for flash programming -# By default use 64kB -if { [info exists WORKAREASIZE] } { - set _WORKAREASIZE $WORKAREASIZE -} else { - set _WORKAREASIZE 0x10000 -} - -if { [info exists CPUTAPID] } { - set _CPUTAPID $CPUTAPID -} else { - set _CPUTAPID 0x2ba01477 -} - -stlink newtap $_CHIPNAME cpu -expected-id $_CPUTAPID - -set _TARGETNAME $_CHIPNAME.cpu -target create $_TARGETNAME stm32_stlink -chain-position $_TARGETNAME - -$_TARGETNAME configure -work-area-phys 0x20000000 -work-area-size $_WORKAREASIZE -work-area-backup 0 - -set _FLASHNAME $_CHIPNAME.flash -flash bank $_FLASHNAME stm32f2x 0x08000000 0 0 0 $_TARGETNAME +# +# STM32f2x stlink pseudo target +# + +set CHIPNAME stm32f2x +set CPUTAPID 0x2ba01477 +set WORKAREASIZE 0x10000 + +source [find target/stm32_stlink.cfg] + +set _FLASHNAME $_CHIPNAME.flash +flash bank $_FLASHNAME stm32f2x 0 0 0 0 $_TARGETNAME diff --git a/tcl/target/stm32f4x_stlink.cfg b/tcl/target/stm32f4x_stlink.cfg new file mode 100644 index 000000000..ec5fb9e48 --- /dev/null +++ b/tcl/target/stm32f4x_stlink.cfg @@ -0,0 +1,13 @@ +# +# STM32f4x stlink pseudo target +# + +set CHIPNAME stm32f4x +set CPUTAPID 0x2ba01477 +set WORKAREASIZE 0x10000 + +source [find target/stm32_stlink.cfg] + +# stm32f4x family uses stm32f2x driver +set _FLASHNAME $_CHIPNAME.flash +flash bank $_FLASHNAME stm32f2x 0 0 0 0 $_TARGETNAME diff --git a/tcl/target/stm32lx_stlink.cfg b/tcl/target/stm32lx_stlink.cfg new file mode 100644 index 000000000..26bd68c59 --- /dev/null +++ b/tcl/target/stm32lx_stlink.cfg @@ -0,0 +1,12 @@ +# +# STM32lx stlink pseudo target +# + +set CHIPNAME stm32lx +set CPUTAPID 0x4ba00477 +set WORKAREASIZE 0x3800 + +source [find target/stm32_stlink.cfg] + +set _FLASHNAME $_CHIPNAME.flash +flash bank $_FLASHNAME stm32lx 0 0 0 0 $_TARGETNAME -- 2.11.4.GIT