aboutsummaryrefslogtreecommitdiff
path: root/tcl/target
diff options
context:
space:
mode:
authorSpencer Oliver <spen@spen-soft.co.uk>2012-02-10 12:29:31 +0000
committerPeter Stuge <peter@stuge.se>2012-02-10 14:23:09 +0000
commitd608dcaa622a7530da16abe5d01ad55e7137fc7b (patch)
treeaf24791d1efca3a0aff3e659bd78f5bad3723903 /tcl/target
parent4db24acb931304355f59560789c5d92b99fb2962 (diff)
downloadriscv-openocd-d608dcaa622a7530da16abe5d01ad55e7137fc7b.zip
riscv-openocd-d608dcaa622a7530da16abe5d01ad55e7137fc7b.tar.gz
riscv-openocd-d608dcaa622a7530da16abe5d01ad55e7137fc7b.tar.bz2
cfg: add ST-LINK TRANSPORT config override
This enables the user to override the transport used for st-link. If JTAG is selected it will also change the default id used to the JTAG id rather than the SW-DP id. Change-Id: I4fe352e4932e2f4ec278168e99ba2d2d50fd850a Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/443 Tested-by: jenkins Reviewed-by: Peter Stuge <peter@stuge.se>
Diffstat (limited to 'tcl/target')
-rw-r--r--tcl/target/stm32_stlink.cfg14
1 files changed, 13 insertions, 1 deletions
diff --git a/tcl/target/stm32_stlink.cfg b/tcl/target/stm32_stlink.cfg
index 9a67b99..4b8abeb 100644
--- a/tcl/target/stm32_stlink.cfg
+++ b/tcl/target/stm32_stlink.cfg
@@ -23,10 +23,22 @@ if { [info exists CPUTAPID] } {
set _CPUTAPID 0x1ba01477
}
+if { [info exists TRANSPORT] } {
+ set _TRANSPORT $TRANSPORT
+ if { $TRANSPORT == "stlink_jtag" } {
+ if { [info exists CPUTAPID] == 0 } {
+ # jtag requires us to use the jtag tap id
+ set _CPUTAPID 0x3ba00477
+ }
+ }
+} else {
+ set _TRANSPORT stlink_swd
+}
+
#
# possibles value are stlink_swd or stlink_jtag
#
-transport select stlink_swd
+transport select $_TRANSPORT
stlink newtap $_CHIPNAME cpu -expected-id $_CPUTAPID