aboutsummaryrefslogtreecommitdiff
path: root/tcl/target/stm32l4x.cfg
diff options
context:
space:
mode:
authorAntonio Borneo <borneo.antonio@gmail.com>2021-11-08 20:14:46 +0100
committerAntonio Borneo <borneo.antonio@gmail.com>2022-08-27 16:15:41 +0000
commit09ca11066b568497cc2a191e9fedbf08673c15c6 (patch)
tree8b9f2e849d6ae564fab449d88369a31e2f953af5 /tcl/target/stm32l4x.cfg
parent65de7c95f41e78746dc41e6173bbee4106a758f9 (diff)
downloadriscv-openocd-09ca11066b568497cc2a191e9fedbf08673c15c6.zip
riscv-openocd-09ca11066b568497cc2a191e9fedbf08673c15c6.tar.gz
riscv-openocd-09ca11066b568497cc2a191e9fedbf08673c15c6.tar.bz2
tcl/target: replace event trace-config
With commit dc7b32ea4a00 ("armv7m_trace: get rid of the old tpiu code") the target's event "trace-config" has been deprecated. Create the TPIU device. Replace the target's event "trace-config" with tpiu's event "pre-enable" in the STM32 devices that require enabling the trace clock _before_ programming the TPIU. Make the script multi-instance-able in case it's used for JTAG chained devices. Uniform the code in STM32F4x with the other scripts. Remove the empty event from STM32WLx. Change-Id: Ifda219c3c5f37e03072a88168611cf505eb630b7 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: https://review.openocd.org/c/openocd/+/6681 Tested-by: jenkins Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
Diffstat (limited to 'tcl/target/stm32l4x.cfg')
-rw-r--r--tcl/target/stm32l4x.cfg9
1 files changed, 5 insertions, 4 deletions
diff --git a/tcl/target/stm32l4x.cfg b/tcl/target/stm32l4x.cfg
index dabdacd..61d25b7 100644
--- a/tcl/target/stm32l4x.cfg
+++ b/tcl/target/stm32l4x.cfg
@@ -40,8 +40,6 @@ if { [info exists CPUTAPID] } {
swj_newdap $_CHIPNAME cpu -irlen 4 -ircapture 0x1 -irmask 0xf -expected-id $_CPUTAPID
dap create $_CHIPNAME.dap -chain-position $_CHIPNAME.cpu
-tpiu create $_CHIPNAME.tpiu -dap $_CHIPNAME.dap -ap-num 0 -baseaddr 0xE0040000
-
if {[using_jtag]} {
jtag newtap $_CHIPNAME bs -irlen 5
}
@@ -103,7 +101,10 @@ $_TARGETNAME configure -event examine-end {
mmw 0xE0042008 0x00001800 0
}
-proc proc_post_enable {_chipname} {
+tpiu create $_CHIPNAME.tpiu -dap $_CHIPNAME.dap -ap-num 0 -baseaddr 0xE0040000
+
+lappend _telnet_autocomplete_skip _proc_pre_enable_$_CHIPNAME.tpiu
+proc _proc_pre_enable_$_CHIPNAME.tpiu {_chipname} {
targets $_chipname.cpu
if { [$_chipname.tpiu cget -protocol] eq "sync" } {
@@ -132,7 +133,7 @@ proc proc_post_enable {_chipname} {
}
}
-$_CHIPNAME.tpiu configure -event post-enable "proc_post_enable $_CHIPNAME"
+$_CHIPNAME.tpiu configure -event pre-enable "_proc_pre_enable_$_CHIPNAME.tpiu $_CHIPNAME"
$_TARGETNAME configure -event reset-init {
# CPU comes out of reset with MSI_ON | MSI_RDY | MSI Range 6 (4 MHz).