Browse Source

stlink: add trace support in DAP direct mode

Reuse the existing tracing functionality of HLA mode to support
tracing in DAP direct mode.

Change-Id: I75a01e88ba5d3e45717e4108b99697ac3225db9e
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/5409
Tested-by: jenkins
Reviewed-by: Oleksij Rempel <linux@rempel-privat.de>
master
Antonio Borneo 1 year ago
parent
commit
ee56c50260
1 changed files with 17 additions and 0 deletions
  1. +17
    -0
      src/jtag/drivers/stlink_usb.c

+ 17
- 0
src/jtag/drivers/stlink_usb.c View File

@@ -3462,6 +3462,21 @@ static void stlink_dap_op_quit(struct adiv5_dap *dap)
LOG_ERROR("Error closing APs");
}

static int stlink_dap_config_trace(bool enabled,
enum tpiu_pin_protocol pin_protocol, uint32_t port_size,
unsigned int *trace_freq, unsigned int traceclkin_freq,
uint16_t *prescaler)
{
return stlink_config_trace(stlink_dap_handle, enabled, pin_protocol,
port_size, trace_freq, traceclkin_freq,
prescaler);
}

static int stlink_dap_trace_read(uint8_t *buf, size_t *size)
{
return stlink_usb_trace_read(stlink_dap_handle, buf, size);
}

/** */
COMMAND_HANDLER(stlink_dap_serial_command)
{
@@ -3645,6 +3660,8 @@ struct adapter_driver stlink_dap_adapter_driver = {
.speed = stlink_dap_speed,
.khz = stlink_dap_khz,
.speed_div = stlink_dap_speed_div,
.config_trace = stlink_dap_config_trace,
.poll_trace = stlink_dap_trace_read,

.dap_jtag_ops = &stlink_dap_ops,
.dap_swd_ops = &stlink_dap_ops,


Loading…
Cancel
Save