target algo: do not write reg_param if direction is PARAM_IN
[openocd.git] / src / target / armv7m_trace.h
1 /***************************************************************************
2 * Copyright (C) 2015 Paul Fertser <fercerpav@gmail.com> *
3 * *
4 * This program is free software; you can redistribute it and/or modify *
5 * it under the terms of the GNU General Public License as published by *
6 * the Free Software Foundation; either version 2 of the License, or *
7 * (at your option) any later version. *
8 * *
9 * This program is distributed in the hope that it will be useful, *
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
12 * GNU General Public License for more details. *
13 * *
14 * You should have received a copy of the GNU General Public License *
15 * along with this program. If not, see <http://www.gnu.org/licenses/>. *
16 ***************************************************************************/
17
18 #ifndef OPENOCD_TARGET_ARMV7M_TRACE_H
19 #define OPENOCD_TARGET_ARMV7M_TRACE_H
20
21 #include <target/target.h>
22 #include <command.h>
23
24 /**
25 * @file
26 * Holds the interface to TPIU, ITM and DWT configuration functions.
27 */
28
29 enum trace_config_type {
30 TRACE_CONFIG_TYPE_DISABLED, /**< tracing is disabled */
31 TRACE_CONFIG_TYPE_EXTERNAL, /**< trace output is captured externally */
32 TRACE_CONFIG_TYPE_INTERNAL /**< trace output is handled by OpenOCD adapter driver */
33 };
34
35 enum tpiu_pin_protocol {
36 TPIU_PIN_PROTOCOL_SYNC, /**< synchronous trace output */
37 TPIU_PIN_PROTOCOL_ASYNC_MANCHESTER, /**< asynchronous output with Manchester coding */
38 TPIU_PIN_PROTOCOL_ASYNC_UART /**< asynchronous output with NRZ coding */
39 };
40
41 enum itm_ts_prescaler {
42 ITM_TS_PRESCALE1, /**< no prescaling for the timestamp counter */
43 ITM_TS_PRESCALE4, /**< refclock divided by 4 for the timestamp counter */
44 ITM_TS_PRESCALE16, /**< refclock divided by 16 for the timestamp counter */
45 ITM_TS_PRESCALE64, /**< refclock divided by 64 for the timestamp counter */
46 };
47
48 struct armv7m_trace_config {
49 /** Currently active trace capture mode */
50 enum trace_config_type config_type;
51
52 /** Currently active trace output mode */
53 enum tpiu_pin_protocol pin_protocol;
54 /** TPIU formatter enable/disable (in async mode) */
55 bool formatter;
56 /** Synchronous output port width */
57 uint32_t port_size;
58
59 /** Bitmask of currenty enabled ITM stimuli */
60 uint32_t itm_ter[8];
61 /** Identifier for multi-source trace stream formatting */
62 unsigned int trace_bus_id;
63 /** Prescaler for the timestamp counter */
64 enum itm_ts_prescaler itm_ts_prescale;
65 /** Enable differential timestamps */
66 bool itm_diff_timestamps;
67 /** Enable async timestamps model */
68 bool itm_async_timestamps;
69 /** Enable synchronisation packet transmission (for sync port only) */
70 bool itm_synchro_packets;
71
72 /** Current frequency of TRACECLKIN (usually matches HCLK) */
73 unsigned int traceclkin_freq;
74 /** Current frequency of trace port */
75 unsigned int trace_freq;
76 /** Handle to output trace data in INTERNAL capture mode */
77 FILE *trace_file;
78 };
79
80 extern const struct command_registration armv7m_trace_command_handlers[];
81
82 /**
83 * Configure hardware accordingly to the current TPIU target settings
84 */
85 int armv7m_trace_tpiu_config(struct target *target);
86 /**
87 * Configure hardware accordingly to the current ITM target settings
88 */
89 int armv7m_trace_itm_config(struct target *target);
90
91 #endif /* OPENOCD_TARGET_ARMV7M_TRACE_H */

Linking to existing account procedure

If you already have an account and want to add another login method you MUST first sign in with your existing account and then change URL to read https://review.openocd.org/login/?link to get to this page again but this time it'll work for linking. Thank you.

SSH host keys fingerprints

1024 SHA256:YKx8b7u5ZWdcbp7/4AeXNaqElP49m6QrwfXaqQGJAOk gerrit-code-review@openocd.zylin.com (DSA)
384 SHA256:jHIbSQa4REvwCFG4cq5LBlBLxmxSqelQPem/EXIrxjk gerrit-code-review@openocd.org (ECDSA)
521 SHA256:UAOPYkU9Fjtcao0Ul/Rrlnj/OsQvt+pgdYSZ4jOYdgs gerrit-code-review@openocd.org (ECDSA)
256 SHA256:A13M5QlnozFOvTllybRZH6vm7iSt0XLxbA48yfc2yfY gerrit-code-review@openocd.org (ECDSA)
256 SHA256:spYMBqEYoAOtK7yZBrcwE8ZpYt6b68Cfh9yEVetvbXg gerrit-code-review@openocd.org (ED25519)
+--[ED25519 256]--+
|=..              |
|+o..   .         |
|*.o   . .        |
|+B . . .         |
|Bo. = o S        |
|Oo.+ + =         |
|oB=.* = . o      |
| =+=.+   + E     |
|. .=o   . o      |
+----[SHA256]-----+
2048 SHA256:0Onrb7/PHjpo6iVZ7xQX2riKN83FJ3KGU0TvI0TaFG4 gerrit-code-review@openocd.zylin.com (RSA)