aboutsummaryrefslogtreecommitdiff
path: root/tcl/target
diff options
context:
space:
mode:
authorIcenowy Zheng <icenowy@aosc.io>2019-09-10 03:32:36 +0800
committerTomas Vanek <vanekt@fbl.cz>2020-01-02 21:17:00 +0000
commit9c5c3ab3d60285fb7976341031705d0340c5fe33 (patch)
treee87c34527c96ebf81d43aff21aacada574700525 /tcl/target
parent2dc88e1479f29ef0141b05bfcd907ad9a3e2d54c (diff)
tcl/target: swm050: fix to allow to use with ST-Link
Currently the code assumes the adapter uses raw SWD, and the expected ID code of the CPU is even wrong. An adapter speed is also not specified. All these prevents the config file to be used with ST-Link. Fix the config file, to allow it to be used with ST-Link. Change-Id: I1244320fabfe8ee23da5a56a592dbeddc72cc8d5 Signed-off-by: Icenowy Zheng <icenowy@aosc.io> Reviewed-on: http://openocd.zylin.com/5297 Tested-by: jenkins Reviewed-by: Caleb Szalacinski <contact@skiboy.net> Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
Diffstat (limited to 'tcl/target')
-rw-r--r--tcl/target/swm050.cfg7
1 files changed, 5 insertions, 2 deletions
diff --git a/tcl/target/swm050.cfg b/tcl/target/swm050.cfg
index a819f9c4..2c4ab34f 100644
--- a/tcl/target/swm050.cfg
+++ b/tcl/target/swm050.cfg
@@ -1,5 +1,7 @@
# Synwit SWM050
+source [find target/swj-dp.tcl]
+
if { [info exists CHIPNAME] } {
set _CHIPNAME $CHIPNAME
} else {
@@ -16,10 +18,10 @@ if { [info exists WORKAREASIZE] } {
if { [info exists CPUTAPID] } {
set _CPUTAPID $CPUTAPID
} else {
- set _CPUTAPID 0x410CC200
+ set _CPUTAPID 0x0bb11477
}
-swd newdap $_CHIPNAME cpu -expected-id $_CPUTAPID
+swj_newdap $_CHIPNAME cpu -expected-id $_CPUTAPID
dap create $_CHIPNAME.dap -chain-position $_CHIPNAME.cpu
set _TARGETNAME $_CHIPNAME.cpu
target create $_TARGETNAME cortex_m -dap $_CHIPNAME.dap
@@ -27,6 +29,7 @@ $_TARGETNAME configure -work-area-phys 0x20000000 -work-area-size $_WORKAREASIZE
set _FLASHNAME $_CHIPNAME.flash
flash bank $_FLASHNAME swm050 0x0 0x2000 0 0 $_TARGETNAME
+adapter_khz 1000
$_TARGETNAME configure -event reset-init {
# Stop the watchdog, just to be safe