aboutsummaryrefslogtreecommitdiff
path: root/tcl
diff options
context:
space:
mode:
authorTarek BOCHKATI <tarek.bouchkati@gmail.com>2021-09-24 13:47:14 +0100
committerAntonio Borneo <borneo.antonio@gmail.com>2022-10-21 18:19:41 +0000
commitc4f88aeb4d1f88f908f96ba252995c5ba247b737 (patch)
tree34601cb1a4f93c3cf811aeeb7c7087433023b53c /tcl
parent535de48ca69ba34860067dfe5ea6f7fa6638f7f9 (diff)
downloadriscv-openocd-c4f88aeb4d1f88f908f96ba252995c5ba247b737.zip
riscv-openocd-c4f88aeb4d1f88f908f96ba252995c5ba247b737.tar.gz
riscv-openocd-c4f88aeb4d1f88f908f96ba252995c5ba247b737.tar.bz2
tcl/stm32l5x|u5x: support HLA adapters in non-secure mode only
instrument "target/stm32x5x_common.cfg" used by both STM32L5x/U5x to support HLA adapters like "interface/stlink.cfg" in non-secure mode if the device switches to secure mode, the debug session will be stopped immediately (with an explanatory message). Change-Id: I645fdd55e3448ef82d0ddcc396f42fd7b2f39ac3 Signed-off-by: Tarek BOCHKATI <tarek.bouchkati@gmail.com> Reported-by: Patrik Bachan <diggit@users.sourceforge.net> Fixes: https://sourceforge.net/p/openocd/tickets/317/ Reviewed-on: https://review.openocd.org/c/openocd/+/6546 Reviewed-by: Tomas Vanek <vanekt@fbl.cz> Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com> Tested-by: jenkins
Diffstat (limited to 'tcl')
-rw-r--r--tcl/target/stm32x5x_common.cfg17
1 files changed, 12 insertions, 5 deletions
diff --git a/tcl/target/stm32x5x_common.cfg b/tcl/target/stm32x5x_common.cfg
index 321abff..fb3aeb1 100644
--- a/tcl/target/stm32x5x_common.cfg
+++ b/tcl/target/stm32x5x_common.cfg
@@ -58,7 +58,9 @@ if {[using_jtag]} {
reset_config srst_nogate
-if {![using_hla]} {
+if {[using_hla]} {
+ echo "Warn : The selected adapter does not support debugging this device in secure mode"
+} else {
# if srst is not fitted use SYSRESETREQ to
# perform a soft reset
cortex_m reset_config sysresetreq
@@ -71,13 +73,18 @@ proc stm32x5x_is_secure {} {
}
proc stm32x5x_ahb_ap_non_secure_access {} {
- # SPROT=1=Non Secure access, Priv=1
- [[target current] cget -dap] apcsw 0x4B000000 0x4F000000
+ # in HLA mode, non-secure debugging is possible without changing the AP CSW
+ if {![using_hla]} {
+ # SPROT=1=Non Secure access, Priv=1
+ [[target current] cget -dap] apcsw 0x4B000000 0x4F000000
+ }
}
proc stm32x5x_ahb_ap_secure_access {} {
- # SPROT=0=Secure access, Priv=1
- [[target current] cget -dap] apcsw 0x0B000000 0x4F000000
+ if {![using_hla]} {
+ # SPROT=0=Secure access, Priv=1
+ [[target current] cget -dap] apcsw 0x0B000000 0x4F000000
+ }
}
$_TARGETNAME configure -event reset-start {