openocd/src
Tomas Vanek 88f429ead0 target/cortex_m: faster reading of all CPU registers
Without the change cortex_m_debug_entry() reads all registers
calling cortex_m_load_core_reg_u32() for each register with
a poor usage of JTAG/SWD queue.
It is time consuming, especially on an USB FS based adapter.
Moreover if target_request debugmsgs are enabled, DCB_DCRDR
is saved and restored on each register read.

This change introduces cortex_m_fast_read_all_regs()
which queues all register reads and a single dap_run() transaction
does all work.

cortex_m_fast_read_all_regs() reads all registers unconditionally
regardless register cache is valid or not. This is a difference
from the original cortex_m_debug_entry() code.

cortex_m_debug_entry times from -d3 log, Cortex-M4F and CMSIS-DAP
(Kinetis K28F-FRDM kit)

target_request |                time [ms]
debugmsgs      | without the change | with the change
---------------+--------------------+-----------------
disable        |        186         |       27
enable         |        232         |       29

Added checking of DHCSR.S_REGRDY flag. If "not ready" is seen,
cortex_m->slow_register_read is set and fallback to the old
register read method cortex_m_slow_read_all_regs() is used
instead of cortex_m_fast_read_all_regs().

Change-Id: I0665d94b97ede217394640871dc451ec93410254
Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-on: https://review.openocd.org/c/openocd/+/5321
Tested-by: jenkins
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
2021-11-18 21:09:34 +00:00
..
flash flash/nor/at91samd: Add SAMR35J18B support 2021-11-18 02:17:41 +00:00
helper helper/log: Add macros for target-related errors/warnings/... 2021-11-13 10:51:52 +00:00
jtag stlink (tcp): manage scattered stlink-server responses 2021-11-13 10:52:25 +00:00
pld openocd: fix simple cases of NULL comparison 2021-07-24 10:37:49 +01:00
rtos rtos: use struct member names instead of comments 2021-11-05 22:45:13 +00:00
rtt openocd: fix doxygen parameters of functions 2021-01-13 11:33:53 +00:00
server helper: Remove src/helper from include dirs 2021-10-02 13:18:15 +00:00
svf openocd: fix Yoda conditions with checkpatch 2021-07-24 10:38:31 +01:00
target target/cortex_m: faster reading of all CPU registers 2021-11-18 21:09:34 +00:00
transport openocd: remove NULL comparisons with checkpatch [1/2] 2021-07-24 10:38:00 +01:00
xsvf openocd: fix simple cases of NULL comparison 2021-07-24 10:37:49 +01:00
Makefile.am build: Fix out-of-tree with --disable-dependency-tracking configure flag 2021-04-05 23:24:14 +01:00
hello.c openocd: fix simple cases of Yoda condition 2021-07-20 14:55:24 +01:00
hello.h Make #include guard naming consistent 2016-05-24 22:30:55 +01:00
main.c Cleanup of config/includes. 2021-05-01 14:35:09 +01:00
openocd.c jtag: remove file driver.h 2021-11-13 10:50:58 +00:00
openocd.h Make #include guard naming consistent 2016-05-24 22:30:55 +01:00