aboutsummaryrefslogtreecommitdiff
path: root/src/target/cortex_m.c
diff options
context:
space:
mode:
authorAntonio Borneo <borneo.antonio@gmail.com>2020-11-13 19:41:41 +0100
committerAntonio Borneo <borneo.antonio@gmail.com>2021-03-10 21:33:09 +0000
commitf9509c92dba370be363f5641d3fefe2250bee10c (patch)
tree448e9a04f6afa2e3bbbe96dbe433e3bdc553113a /src/target/cortex_m.c
parentfaaa42283f5c06830fe997b80d6c64f6469c6cf0 (diff)
downloadriscv-openocd-f9509c92dba370be363f5641d3fefe2250bee10c.zip
riscv-openocd-f9509c92dba370be363f5641d3fefe2250bee10c.tar.gz
riscv-openocd-f9509c92dba370be363f5641d3fefe2250bee10c.tar.bz2
itm: rework itm commands before 'init'
If the command 'itm port[s]' is issued before 'init', the ITM can not be programmed because OpenOCD cannot access the target yet. The configuration is recorded and applied after target examine. The current test to trigger the ITM delayed-programming is based on the TPIU configuration. This is allowed because the only use of ITM it so send data through TPIU. In case of system TPIU, not belonging anymore to the target, there is no more association between target ITM and system TPIU. Add a flag to record the pending ITM configuration requested before 'init' and test the flag to trigger the delayed-programming of the ITM. Change-Id: I101eb97a116d7925cd2ff068f3e8813fc008b08e Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-on: http://openocd.zylin.com/6029 Tested-by: jenkins
Diffstat (limited to 'src/target/cortex_m.c')
-rw-r--r--src/target/cortex_m.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/target/cortex_m.c b/src/target/cortex_m.c
index ce2c426..4580c10 100644
--- a/src/target/cortex_m.c
+++ b/src/target/cortex_m.c
@@ -2082,10 +2082,11 @@ int cortex_m_examine(struct target *target)
if (retval != ERROR_OK)
return retval;
- if (armv7m->trace_config.config_type != TRACE_CONFIG_TYPE_DISABLED) {
+ if (armv7m->trace_config.config_type != TRACE_CONFIG_TYPE_DISABLED)
armv7m_trace_tpiu_config(target);
+
+ if (armv7m->trace_config.itm_deferred_config)
armv7m_trace_itm_config(target);
- }
/* NOTE: FPB and DWT are both optional. */