X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=src%2Ftarget%2Farmv7m_trace.h;h=cdf79e74cb344694445f7a3e9770411b390c6009;hb=a8b88acd994f758a02a48e2f6fb372caff887e75;hp=96c18958700bbc76ba1b748c752391bcd932354f;hpb=a09a75653dbe7ad99da6349285ab6622b80fdc15;p=fw%2Fopenocd
diff --git a/src/target/armv7m_trace.h b/src/target/armv7m_trace.h
index 96c189587..cdf79e74c 100644
--- a/src/target/armv7m_trace.h
+++ b/src/target/armv7m_trace.h
@@ -10,11 +10,16 @@
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program. If not, see . *
***************************************************************************/
-#ifndef ARMV7M_TRACE_H
-#define ARMV7M_TRACE_H
+#ifndef OPENOCD_TARGET_ARMV7M_TRACE_H
+#define OPENOCD_TARGET_ARMV7M_TRACE_H
+#include
+#include
#include
/**
@@ -23,15 +28,21 @@
*/
enum trace_config_type {
- DISABLED, /**< tracing is disabled */
- EXTERNAL, /**< trace output is captured externally */
- INTERNAL /**< trace output is handled by OpenOCD adapter driver */
+ TRACE_CONFIG_TYPE_DISABLED, /**< tracing is disabled */
+ TRACE_CONFIG_TYPE_EXTERNAL, /**< trace output is captured externally */
+ TRACE_CONFIG_TYPE_INTERNAL /**< trace output is handled by OpenOCD adapter driver */
+};
+
+enum trace_internal_channel {
+ TRACE_INTERNAL_CHANNEL_TCL_ONLY, /** trace data is sent only to 'tcl_trace' */
+ TRACE_INTERNAL_CHANNEL_FILE, /** trace data is appended to a file */
+ TRACE_INTERNAL_CHANNEL_TCP /** trace data is appended to a TCP/IP port*/
};
-enum tpio_pin_protocol {
- SYNC, /**< synchronous trace output */
- ASYNC_MANCHESTER, /**< asynchronous output with Manchester coding */
- ASYNC_UART /**< asynchronous output with NRZ coding */
+enum tpiu_pin_protocol {
+ TPIU_PIN_PROTOCOL_SYNC, /**< synchronous trace output */
+ TPIU_PIN_PROTOCOL_ASYNC_MANCHESTER, /**< asynchronous output with Manchester coding */
+ TPIU_PIN_PROTOCOL_ASYNC_UART /**< asynchronous output with NRZ coding */
};
enum itm_ts_prescaler {
@@ -45,14 +56,17 @@ struct armv7m_trace_config {
/** Currently active trace capture mode */
enum trace_config_type config_type;
+ /** The used channel when internal mode is selected */
+ enum trace_internal_channel internal_channel;
+
/** Currently active trace output mode */
- enum tpio_pin_protocol pin_protocol;
+ enum tpiu_pin_protocol pin_protocol;
/** TPIU formatter enable/disable (in async mode) */
bool formatter;
/** Synchronous output port width */
uint32_t port_size;
- /** Bitmask of currenty enabled ITM stimuli */
+ /** Bitmask of currently enabled ITM stimuli */
uint32_t itm_ter[8];
/** Identifier for multi-source trace stream formatting */
unsigned int trace_bus_id;
@@ -69,8 +83,10 @@ struct armv7m_trace_config {
unsigned int traceclkin_freq;
/** Current frequency of trace port */
unsigned int trace_freq;
- /** Handle to output trace data in INTERNAL capture mode */
+ /** Handle to output trace data in INTERNAL capture mode via file */
FILE *trace_file;
+ /** Handle to output trace data in INTERNAL capture mode via tcp */
+ struct service *trace_service;
};
extern const struct command_registration armv7m_trace_command_handlers[];
@@ -79,9 +95,13 @@ extern const struct command_registration armv7m_trace_command_handlers[];
* Configure hardware accordingly to the current TPIU target settings
*/
int armv7m_trace_tpiu_config(struct target *target);
+/**
+ * Disable TPIU data gathering at exit
+ */
+int armv7m_trace_tpiu_exit(struct target *target);
/**
* Configure hardware accordingly to the current ITM target settings
*/
int armv7m_trace_itm_config(struct target *target);
-#endif
+#endif /* OPENOCD_TARGET_ARMV7M_TRACE_H */