From 9d5f833fbd47a5a0631fa1f6f1734f277fdde342 Mon Sep 17 00:00:00 2001 From: Tomas Vanek Date: Tue, 11 Oct 2022 19:04:15 +0200 Subject: [PATCH] tcl/target: fix rp2040-core0.cfg work area backup. The work area should be backed up. The flash probe runs an algorithm on the target CPU. The flash is probed during gdb connect if gdb_memory_map is enabled (is enabled by default). Without backup the target memory gets corrupted on gdb connect. Change-Id: I3344b9dc6cbf904d49f3b05ab104b541d1d63422 Signed-off-by: Tomas Vanek Reviewed-on: https://review.openocd.org/c/openocd/+/7257 Tested-by: jenkins Reviewed-by: Jonathan Bell --- tcl/target/rp2040-core0.cfg | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tcl/target/rp2040-core0.cfg b/tcl/target/rp2040-core0.cfg index 8c3533bfb..6a0f0ed61 100644 --- a/tcl/target/rp2040-core0.cfg +++ b/tcl/target/rp2040-core0.cfg @@ -26,7 +26,10 @@ 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 -$_TARGETNAME configure -work-area-phys 0x20010000 -work-area-size $_WORKAREASIZE + +# Backup the work area. The flash probe runs an algorithm on the target CPU. +# The flash is probed during gdb connect if gdb_memory_map is enabled (by default). +$_TARGETNAME configure -work-area-phys 0x20010000 -work-area-size $_WORKAREASIZE -work-area-backup 1 set _FLASHNAME $_CHIPNAME.flash set _FLASHSIZE 0x200000