This is an automated email from Gerrit. "zapb <d...@zapb.de>" just uploaded a new patch set to Gerrit, which you can find at https://review.openocd.org/c/openocd/+/8256
-- gerrit commit 4d868e3d9894cead57b804b85fc25826f0c102f6 Author: Marc Schink <d...@zapb.de> Date: Sun May 5 15:28:20 2024 +0200 tcl/target/nrf52: Configure trace port speed Configure the TRACECONFIG.TRACEPORTSPEED register depending on the trace clock speed. Also catch invalid trace clock speeds. Change-Id: I1ece1cc59da539732d2d71f296fd55799c195387 Signed-off-by: Marc Schink <d...@zapb.de> diff --git a/tcl/target/nrf52.cfg b/tcl/target/nrf52.cfg index a9121d3561..078d34ad93 100644 --- a/tcl/target/nrf52.cfg +++ b/tcl/target/nrf52.cfg @@ -131,6 +131,24 @@ proc _proc_pre_enable_$_CHIPNAME.tpiu {_targetname _chipname} { 0x52840 - 0x52833 - 0x52832 { + # Configuration values for all supported trace port speeds, see + # TRACECONFIG.TRACEPORTSPEED + set trace_port_speeds { + 32000000 0 + 16000000 1 + 8000000 2 + 4000000 3 + } + + set traceclk [$_chipname.tpiu cget -traceclk] + + if { ![dict exists $trace_port_speeds $traceclk] } { + error "Trace clock speed is not supported" + } + + # Set TRACECONFIG.TRACEPORTSPEED + mmw 0x4000055C [dict get $trace_port_speeds $traceclk] 0x3 + if { [$_chipname.tpiu cget -protocol] eq "sync" } { if { [$_chipname.tpiu cget -port-width] != 4 } { error "Device only supports 4-bit sync traces" --