diff options
author | Tarek BOCHKATI <tarek.bouchkati@gmail.com> | 2021-01-22 13:15:52 +0100 |
---|---|---|
committer | Oleksij Rempel <linux@rempel-privat.de> | 2021-08-26 06:21:38 +0000 |
commit | e609d5a5de84b3daf8b9524143e41a6c0713fd8f (patch) | |
tree | 18ae3ad18b757f47727be7f4e246cadd6c38f7e5 /tcl | |
parent | c9d40366ad55ea3a83f2ff438aab1e62da653169 (diff) | |
download | riscv-openocd-e609d5a5de84b3daf8b9524143e41a6c0713fd8f.zip riscv-openocd-e609d5a5de84b3daf8b9524143e41a6c0713fd8f.tar.gz riscv-openocd-e609d5a5de84b3daf8b9524143e41a6c0713fd8f.tar.bz2 |
flash/stm32l4x: STM32L5 support programming when TZEN=1 and RDP=0x55
when RDP level is 0.5 the provided work-area should reside in non-secure RAM
to ensure that:
- add a hint in the driver level
- reduce the usage of secure RAM only when TZEN=1 and RDP is not 0.5
(check the target configuration file)
Change-Id: Idbf2325e609b84ef8480eefdb49a176fdf7e07c7
Signed-off-by: Tarek BOCHKATI <tarek.bouchkati@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/6035
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-by: Oleksij Rempel <linux@rempel-privat.de>
Tested-by: jenkins
Diffstat (limited to 'tcl')
-rw-r--r-- | tcl/target/stm32l5x.cfg | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/tcl/target/stm32l5x.cfg b/tcl/target/stm32l5x.cfg index 02297e3..0616df1 100644 --- a/tcl/target/stm32l5x.cfg +++ b/tcl/target/stm32l5x.cfg @@ -173,7 +173,11 @@ $_TARGETNAME configure -event gdb-flash-erase-start { } { ahb_ap_secure_access echo "TZEN option bit enabled" - set use_secure_workarea 1 + + # check if FLASH_OPTR.RDP is not Level 0.5 + if {[expr {$FLASH_OPTR & 0xFF}] != 0x55} { + set use_secure_workarea 1 + } } set workarea_addr [$_TARGETNAME cget -work-area-phys] |