diff options
Diffstat (limited to 'src/target/cortex_m.c')
-rw-r--r-- | src/target/cortex_m.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/target/cortex_m.c b/src/target/cortex_m.c index 4dc92c8..9234824 100644 --- a/src/target/cortex_m.c +++ b/src/target/cortex_m.c @@ -1932,6 +1932,16 @@ int cortex_m_examine(struct target *target) armv7m->dap.tar_autoincr_block = (1 << 12); } + /* Configure trace modules */ + retval = target_write_u32(target, DCB_DEMCR, TRCENA | armv7m->demcr); + if (retval != ERROR_OK) + return retval; + + if (armv7m->trace_config.config_type != DISABLED) { + armv7m_trace_tpiu_config(target); + armv7m_trace_itm_config(target); + } + /* NOTE: FPB and DWT are both optional. */ /* Setup FPB */ @@ -2325,6 +2335,9 @@ static const struct command_registration cortex_m_command_handlers[] = { .chain = armv7m_command_handlers, }, { + .chain = armv7m_trace_command_handlers, + }, + { .name = "cortex_m", .mode = COMMAND_EXEC, .help = "Cortex-M command group", |