1 /* SPDX-License-Identifier: GPL-2.0-or-later */
3 /***************************************************************************
4 * ESP32 application trace module *
5 * Copyright (C) 2017-2019 Espressif Systems Ltd. *
6 ***************************************************************************/
8 #ifndef OPENOCD_TARGET_ESP32_APPTRACE_H
9 #define OPENOCD_TARGET_ESP32_APPTRACE_H
11 #include <helper/command.h>
12 #include <helper/time_support.h>
13 #include <target/target.h>
15 #define ESP32_APPTRACE_MAX_CORES_NUM 2
17 struct esp32_apptrace_hw
{
18 uint32_t max_block_id
;
19 uint32_t (*max_block_size_get
)(struct target
*target
);
20 int (*status_reg_read
)(struct target
*target
, uint32_t *stat
);
21 int (*ctrl_reg_write
)(struct target
*target
,
26 int (*ctrl_reg_read
)(struct target
*target
,
30 int (*data_len_read
)(struct target
*target
,
33 int (*data_read
)(struct target
*target
,
38 uint32_t (*usr_block_max_size_get
)(struct target
*target
);
39 int (*buffs_write
)(struct target
*target
,
42 const uint8_t *bufs
[],
46 int (*leave_trace_crit_section_start
)(struct target
*target
);
47 int (*leave_trace_crit_section_stop
)(struct target
*target
);
50 struct esp_apptrace_host2target_hdr
{
54 struct esp32_apptrace_dest
{
56 int (*write
)(void *priv
, uint8_t *data
, int size
);
57 int (*clean
)(void *priv
);
61 struct esp32_apptrace_format
{
63 int (*core_id_get
)(struct target
*target
, uint8_t *hdr_buf
);
64 uint32_t (*usr_block_len_get
)(struct target
*target
, uint8_t *hdr_buf
, uint32_t *wr_len
);
67 struct esp32_apptrace_cmd_stats
{
68 uint32_t incompl_blocks
;
70 float min_blk_read_time
;
71 float max_blk_read_time
;
72 float min_blk_proc_time
;
73 float max_blk_proc_time
;
76 struct esp32_apptrace_cmd_ctx
{
79 /* TODO: use subtargets from target arch info */
80 struct target
*cpus
[ESP32_APPTRACE_MAX_CORES_NUM
];
81 /* TODO: use cores num from target */
82 unsigned int cores_num
;
83 const struct esp32_apptrace_hw
*hw
;
84 enum target_state target_state
;
86 struct list_head free_trace_blocks
;
87 struct list_head ready_trace_blocks
;
88 uint32_t max_trace_block_sz
;
89 struct esp32_apptrace_format trace_format
;
90 int (*process_data
)(struct esp32_apptrace_cmd_ctx
*ctx
, unsigned int core_id
, uint8_t *data
, uint32_t data_len
);
91 void (*auto_clean
)(struct esp32_apptrace_cmd_ctx
*ctx
);
95 struct esp32_apptrace_cmd_stats stats
;
96 struct duration read_time
;
97 struct duration idle_time
;
99 struct target
*target
;
100 struct command_invocation
*cmd
;
103 struct esp32_apptrace_cmd_data
{
104 struct esp32_apptrace_dest data_dest
;
105 uint32_t poll_period
;
111 int esp32_apptrace_cmd_ctx_init(struct esp32_apptrace_cmd_ctx
*cmd_ctx
, struct command_invocation
*cmd
, int mode
);
112 int esp32_apptrace_cmd_ctx_cleanup(struct esp32_apptrace_cmd_ctx
*cmd_ctx
);
113 void esp32_apptrace_cmd_args_parse(struct esp32_apptrace_cmd_ctx
*cmd_ctx
,
114 struct esp32_apptrace_cmd_data
*cmd_data
,
117 int esp32_apptrace_dest_init(struct esp32_apptrace_dest dest
[], const char *dest_paths
[], unsigned int max_dests
);
118 int esp32_apptrace_dest_cleanup(struct esp32_apptrace_dest dest
[], unsigned int max_dests
);
119 int esp_apptrace_usr_block_write(const struct esp32_apptrace_hw
*hw
, struct target
*target
,
124 extern const struct command_registration esp32_apptrace_command_handlers
[];
126 #endif /* OPENOCD_TARGET_ESP32_APPTRACE_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)