![]()
![]()
#include "config.h"
![]()
![]()
#include <helper/align.h>
![]()
![]()
#include <helper/binarybuffer.h>
![]()
![]()
#include <helper/bits.h>
![]()
![]()
#include <helper/system.h>
![]()
![]()
#include <helper/time_support.h>
![]()
![]()
#include <jtag/adapter.h>
![]()
![]()
#include <jtag/interface.h>
![]()
![]()
#include <jtag/hla/hla_layout.h>
![]()
![]()
#include <jtag/hla/hla_transport.h>
![]()
![]()
#include <jtag/hla/hla_interface.h>
![]()
![]()
#include <jtag/swim.h>
![]()
![]()
#include <target/arm_adi_v5.h>
![]()
![]()
#include <target/target.h>
![]()
![]()
#include <transport/transport.h>
![]()
![]()
#include <target/cortex_m.h>
![]()
![]()
#include <helper/system.h>
![]()
![]()
#include <arpa/inet.h>
![]()
![]()
#include <netinet/tcp.h>
![]()
![]()
#include "libusb_helper.h"
![]()
![]()
#define USE_LIBUSB_ASYNCIO
![]()
![]()
#define STLINK_SERIAL_LEN
![]()
![]()
#define ENDPOINT_IN
![]()
![]()
#define ENDPOINT_OUT
![]()
![]()
#define STLINK_WRITE_TIMEOUT
![]()
![]()
#define STLINK_READ_TIMEOUT
![]()
![]()
#define STLINK_RX_EP
![]()
![]()
#define STLINK_TX_EP
![]()
![]()
#define STLINK_TRACE_EP
![]()
![]()
#define STLINK_V2_1_TX_EP
![]()
![]()
#define STLINK_V2_1_TRACE_EP
![]()
![]()
#define STLINK_SG_SIZE
![]()
![]()
#define STLINK_DATA_SIZE
![]()
![]()
#define STLINK_CMD_SIZE_V2
![]()
![]()
#define STLINK_CMD_SIZE_V1
![]()
![]()
#define STLINK_V1_PID
![]()
![]()
#define STLINK_V2_PID
![]()
![]()
#define STLINK_V2_1_PID
![]()
![]()
#define STLINK_V2_1_NO_MSD_PID
![]()
![]()
#define STLINK_V3_USBLOADER_PID
![]()
![]()
#define STLINK_V3E_PID
![]()
![]()
#define STLINK_V3S_PID
![]()
![]()
#define STLINK_V3_2VCP_PID
![]()
![]()
#define STLINK_V3E_NO_MSD_PID
![]()
![]()
#define STLINK_V3P_USBLOADER_PID
![]()
![]()
#define STLINK_V3P_PID
![]()
![]()
#define STLINK_MAX_RW8
![]()
![]()
#define STLINKV3_MAX_RW8
![]()
![]()
#define STLINK_MAX_RW16_32
![]()
![]()
#define STLINK_SWIM_DATA_SIZE
![]()
![]()
#define MAX_WAIT_RETRIES
![]()
![]()
#define STLINK_HLA_AP_NUM
![]()
![]()
#define STLINK_HLA_CSW
![]()
![]()
stlink_jtag_api_version
![]()
![]()
STLINK_JTAG_API_V1
![]()
![]()
STLINK_JTAG_API_V2
![]()
![]()
STLINK_JTAG_API_V3
![]()
![]()
stlink_mode
![]()
![]()
STLINK_MODE_UNKNOWN
![]()
![]()
STLINK_MODE_DFU
![]()
![]()
STLINK_MODE_MASS
![]()
![]()
STLINK_MODE_DEBUG_JTAG
![]()
![]()
STLINK_MODE_DEBUG_SWD
![]()
![]()
STLINK_MODE_DEBUG_SWIM
![]()
![]()
stlink_usb_version
![]()
![]()
stlink
![]()
![]()
jtag
![]()
![]()
swim
![]()
![]()
jtag_api
![]()
![]()
flags
![]()
![]()
stlink_usb_priv
![]()
![]()
libusb_device_handle
![]()
![]()
fd
![]()
![]()
libusb_transfer
![]()
![]()
trans
![]()
![]()
stlink_tcp_version
![]()
![]()
api
![]()
![]()
major
![]()
![]()
minor
![]()
![]()
build
![]()
![]()
stlink_tcp_priv
![]()
![]()
fd
![]()
![]()
connected
![]()
![]()
device_id
![]()
![]()
connect_id
![]()
![]()
send_buf
![]()
![]()
recv_buf
![]()
![]()
version
![]()
![]()
stlink_backend
![]()
![]()
open
![]()
![]()
close
![]()
![]()
xfer_noerrcheck
![]()
![]()
read_trace
![]()
![]()
#define MAX_QUEUE_DEPTH
![]()
![]()
queue_cmd
![]()
![]()
CMD_DP_READ
![]()
![]()
CMD_DP_WRITE
![]()
![]()
CMD_AP_READ
![]()
![]()
CMD_AP_WRITE
![]()
![]()
CMD_MEM_AP_READ8
![]()
![]()
CMD_MEM_AP_READ16
![]()
![]()
CMD_MEM_AP_READ32
![]()
![]()
CMD_MEM_AP_WRITE8
![]()
![]()
CMD_MEM_AP_WRITE16
![]()
![]()
CMD_MEM_AP_WRITE32
![]()
![]()
#define CMD_MEM_AP_2_SIZE
![]()
![]()
dap_queue
![]()
![]()
cmd
![]()
![]()
<anonymous union>
![]()
![]()
dp_r
![]()
![]()
reg
![]()
![]()
dap
![]()
![]()
p_data
![]()
![]()
dp_r
![]()
![]()
dp_w
![]()
![]()
reg
![]()
![]()
dap
![]()
![]()
data
![]()
![]()
dp_w
![]()
![]()
ap_r
![]()
![]()
reg
![]()
![]()
ap
![]()
![]()
p_data
![]()
![]()
ap_r
![]()
![]()
ap_w
![]()
![]()
reg
![]()
![]()
ap
![]()
![]()
data
![]()
![]()
changes_csw_default
![]()
![]()
ap_w
![]()
![]()
mem_ap
![]()
![]()
addr
![]()
![]()
ap
![]()
![]()
<anonymous union>
![]()
![]()
p_data
![]()
![]()
data
![]()
![]()
csw
![]()
![]()
mem_ap
![]()
![]()
stlink_usb_handle
![]()
![]()
backend
![]()
![]()
<anonymous union>
![]()
![]()
usb_backend_priv
![]()
![]()
tcp_backend_priv
![]()
![]()
rx_ep
![]()
![]()
tx_ep
![]()
![]()
trace_ep
![]()
![]()
cmdbuf
![]()
![]()
cmdidx
![]()
![]()
direction
![]()
![]()
databuf
![]()
![]()
max_mem_packet
![]()
![]()
st_mode
![]()
![]()
version
![]()
![]()
vid
![]()
![]()
pid
![]()
![]()
<anonymous struct>
![]()
![]()
enabled
![]()
![]()
source_hz
![]()
![]()
trace
![]()
![]()
reconnect_pending
![]()
![]()
queue
![]()
![]()
queue_index
![]()
![]()
stlink_usb_open(void *, struct hl_interface_param *)
![]()
![]()
stlink_usb_close(void *)
![]()
![]()
stlink_usb_xfer_noerrcheck(void *, const uint8_t *, int)
![]()
![]()
#define STLINK_SWIM_ERR_OK
![]()
![]()
#define STLINK_SWIM_BUSY
![]()
![]()
#define STLINK_DEBUG_ERR_OK
![]()
![]()
#define STLINK_DEBUG_ERR_FAULT
![]()
![]()
#define STLINK_SWD_AP_WAIT
![]()
![]()
#define STLINK_SWD_AP_FAULT
![]()
![]()
#define STLINK_SWD_AP_ERROR
![]()
![]()
#define STLINK_SWD_AP_PARITY_ERROR
![]()
![]()
#define STLINK_JTAG_GET_IDCODE_ERROR
![]()
![]()
#define STLINK_JTAG_WRITE_ERROR
![]()
![]()
#define STLINK_JTAG_WRITE_VERIF_ERROR
![]()
![]()
#define STLINK_SWD_DP_WAIT
![]()
![]()
#define STLINK_SWD_DP_FAULT
![]()
![]()
#define STLINK_SWD_DP_ERROR
![]()
![]()
#define STLINK_SWD_DP_PARITY_ERROR
![]()
![]()
#define STLINK_SWD_AP_WDATA_ERROR
![]()
![]()
#define STLINK_SWD_AP_STICKY_ERROR
![]()
![]()
#define STLINK_SWD_AP_STICKYORUN_ERROR
![]()
![]()
#define STLINK_BAD_AP_ERROR
![]()
![]()
#define STLINK_CORE_RUNNING
![]()
![]()
#define STLINK_CORE_HALTED
![]()
![]()
#define STLINK_CORE_STAT_UNKNOWN
![]()
![]()
#define STLINK_GET_VERSION
![]()
![]()
#define STLINK_DEBUG_COMMAND
![]()
![]()
#define STLINK_DFU_COMMAND
![]()
![]()
#define STLINK_SWIM_COMMAND
![]()
![]()
#define STLINK_GET_CURRENT_MODE
![]()
![]()
#define STLINK_GET_TARGET_VOLTAGE
![]()
![]()
#define STLINK_DEV_DFU_MODE
![]()
![]()
#define STLINK_DEV_MASS_MODE
![]()
![]()
#define STLINK_DEV_DEBUG_MODE
![]()
![]()
#define STLINK_DEV_SWIM_MODE
![]()
![]()
#define STLINK_DEV_BOOTLOADER_MODE
![]()
![]()
#define STLINK_DEV_UNKNOWN_MODE
![]()
![]()
#define STLINK_DFU_EXIT
![]()
![]()
#define STLINK_SWIM_ENTER
![]()
![]()
#define STLINK_SWIM_EXIT
![]()
![]()
#define STLINK_SWIM_READ_CAP
![]()
![]()
#define STLINK_SWIM_SPEED
![]()
![]()
#define STLINK_SWIM_ENTER_SEQ
![]()
![]()
#define STLINK_SWIM_GEN_RST
![]()
![]()
#define STLINK_SWIM_RESET
![]()
![]()
#define STLINK_SWIM_ASSERT_RESET
![]()
![]()
#define STLINK_SWIM_DEASSERT_RESET
![]()
![]()
#define STLINK_SWIM_READSTATUS
![]()
![]()
#define STLINK_SWIM_WRITEMEM
![]()
![]()
#define STLINK_SWIM_READMEM
![]()
![]()
#define STLINK_SWIM_READBUF
![]()
![]()
#define STLINK_DEBUG_GETSTATUS
![]()
![]()
#define STLINK_DEBUG_FORCEDEBUG
![]()
![]()
#define STLINK_DEBUG_APIV1_RESETSYS
![]()
![]()
#define STLINK_DEBUG_APIV1_READALLREGS
![]()
![]()
#define STLINK_DEBUG_APIV1_READREG
![]()
![]()
#define STLINK_DEBUG_APIV1_WRITEREG
![]()
![]()
#define STLINK_DEBUG_READMEM_32BIT
![]()
![]()
#define STLINK_DEBUG_WRITEMEM_32BIT
![]()
![]()
#define STLINK_DEBUG_RUNCORE
![]()
![]()
#define STLINK_DEBUG_STEPCORE
![]()
![]()
#define STLINK_DEBUG_APIV1_SETFP
![]()
![]()
#define STLINK_DEBUG_READMEM_8BIT
![]()
![]()
#define STLINK_DEBUG_WRITEMEM_8BIT
![]()
![]()
#define STLINK_DEBUG_APIV1_CLEARFP
![]()
![]()
#define STLINK_DEBUG_APIV1_WRITEDEBUGREG
![]()
![]()
#define STLINK_DEBUG_APIV1_SETWATCHPOINT
![]()
![]()
#define STLINK_DEBUG_ENTER_JTAG_RESET
![]()
![]()
#define STLINK_DEBUG_ENTER_SWD_NO_RESET
![]()
![]()
#define STLINK_DEBUG_ENTER_JTAG_NO_RESET
![]()
![]()
#define STLINK_DEBUG_APIV1_ENTER
![]()
![]()
#define STLINK_DEBUG_EXIT
![]()
![]()
#define STLINK_DEBUG_READCOREID
![]()
![]()
#define STLINK_DEBUG_APIV2_ENTER
![]()
![]()
#define STLINK_DEBUG_APIV2_READ_IDCODES
![]()
![]()
#define STLINK_DEBUG_APIV2_RESETSYS
![]()
![]()
#define STLINK_DEBUG_APIV2_READREG
![]()
![]()
#define STLINK_DEBUG_APIV2_WRITEREG
![]()
![]()
#define STLINK_DEBUG_APIV2_WRITEDEBUGREG
![]()
![]()
#define STLINK_DEBUG_APIV2_READDEBUGREG
![]()
![]()
#define STLINK_DEBUG_APIV2_READALLREGS
![]()
![]()
#define STLINK_DEBUG_APIV2_GETLASTRWSTATUS
![]()
![]()
#define STLINK_DEBUG_APIV2_DRIVE_NRST
![]()
![]()
#define STLINK_DEBUG_APIV2_GETLASTRWSTATUS2
![]()
![]()
#define STLINK_DEBUG_APIV2_START_TRACE_RX
![]()
![]()
#define STLINK_DEBUG_APIV2_STOP_TRACE_RX
![]()
![]()
#define STLINK_DEBUG_APIV2_GET_TRACE_NB
![]()
![]()
#define STLINK_DEBUG_APIV2_SWD_SET_FREQ
![]()
![]()
#define STLINK_DEBUG_APIV2_JTAG_SET_FREQ
![]()
![]()
#define STLINK_DEBUG_APIV2_READ_DAP_REG
![]()
![]()
#define STLINK_DEBUG_APIV2_WRITE_DAP_REG
![]()
![]()
#define STLINK_DEBUG_APIV2_READMEM_16BIT
![]()
![]()
#define STLINK_DEBUG_APIV2_WRITEMEM_16BIT
![]()
![]()
#define STLINK_DEBUG_APIV2_INIT_AP
![]()
![]()
#define STLINK_DEBUG_APIV2_CLOSE_AP_DBG
![]()
![]()
#define STLINK_DEBUG_WRITEMEM_32BIT_NO_ADDR_INC
![]()
![]()
#define STLINK_DEBUG_APIV2_RW_MISC_OUT
![]()
![]()
#define STLINK_DEBUG_APIV2_RW_MISC_IN
![]()
![]()
#define STLINK_DEBUG_READMEM_32BIT_NO_ADDR_INC
![]()
![]()
#define STLINK_APIV3_SET_COM_FREQ
![]()
![]()
#define STLINK_APIV3_GET_COM_FREQ
![]()
![]()
#define STLINK_APIV3_GET_VERSION_EX
![]()
![]()
#define STLINK_DEBUG_APIV2_DRIVE_NRST_LOW
![]()
![]()
#define STLINK_DEBUG_APIV2_DRIVE_NRST_HIGH
![]()
![]()
#define STLINK_DEBUG_APIV2_DRIVE_NRST_PULSE
![]()
![]()
#define STLINK_DEBUG_PORT_ACCESS
![]()
![]()
#define STLINK_TRACE_SIZE
![]()
![]()
#define STLINK_TRACE_MAX_HZ
![]()
![]()
#define STLINK_V3_TRACE_MAX_HZ
![]()
![]()
#define STLINK_V3_MAX_FREQ_NB
![]()
![]()
#define REQUEST_SENSE
![]()
![]()
#define REQUEST_SENSE_LENGTH
![]()
![]()
#define STLINK_TCP_CMD_REFRESH_DEVICE_LIST
![]()
![]()
#define STLINK_TCP_CMD_GET_NB_DEV
![]()
![]()
#define STLINK_TCP_CMD_GET_DEV_INFO
![]()
![]()
#define STLINK_TCP_CMD_OPEN_DEV
![]()
![]()
#define STLINK_TCP_CMD_CLOSE_DEV
![]()
![]()
#define STLINK_TCP_CMD_SEND_USB_CMD
![]()
![]()
#define STLINK_TCP_CMD_GET_SERVER_VERSION
![]()
![]()
#define STLINK_TCP_CMD_GET_NB_OF_DEV_CLIENTS
![]()
![]()
#define OPENOCD_STLINK_TCP_API_VERSION
![]()
![]()
#define STLINK_TCP_REQUEST_WRITE
![]()
![]()
#define STLINK_TCP_REQUEST_READ
![]()
![]()
#define STLINK_TCP_REQUEST_READ_SWO
![]()
![]()
#define STLINK_TCP_SS_SIZE
![]()
![]()
#define STLINK_TCP_USB_CMD_SIZE
![]()
![]()
#define STLINK_TCP_SERIAL_SIZE
![]()
![]()
#define STLINK_TCP_SEND_BUFFER_SIZE
![]()
![]()
#define STLINK_TCP_RECV_BUFFER_SIZE
![]()
![]()
#define STLINK_TCP_SS_OK
![]()
![]()
#define STLINK_TCP_SS_MEMORY_PROBLEM
![]()
![]()
#define STLINK_TCP_SS_TIMEOUT
![]()
![]()
#define STLINK_TCP_SS_BAD_PARAMETER
![]()
![]()
#define STLINK_TCP_SS_OPEN_ERR
![]()
![]()
#define STLINK_TCP_SS_TRUNCATED_DATA
![]()
![]()
#define STLINK_TCP_SS_CMD_NOT_AVAILABLE
![]()
![]()
#define STLINK_TCP_SS_TCP_ERROR
![]()
![]()
#define STLINK_TCP_SS_TCP_CANT_CONNECT
![]()
![]()
#define STLINK_TCP_SS_TCP_CLOSE_ERROR
![]()
![]()
#define STLINK_TCP_SS_TCP_BUSY
![]()
![]()
#define STLINK_TCP_SS_WIN32_ERROR
![]()
![]()
#define STLINK_F_HAS_TRACE
![]()
![]()
#define STLINK_F_HAS_GETLASTRWSTATUS2
![]()
![]()
#define STLINK_F_HAS_SWD_SET_FREQ
![]()
![]()
#define STLINK_F_HAS_JTAG_SET_FREQ
![]()
![]()
#define STLINK_F_QUIRK_JTAG_DP_READ
![]()
![]()
#define STLINK_F_HAS_DAP_REG
![]()
![]()
#define STLINK_F_HAS_MEM_16BIT
![]()
![]()
#define STLINK_F_HAS_AP_INIT
![]()
![]()
#define STLINK_F_FIX_CLOSE_AP
![]()
![]()
#define STLINK_F_HAS_DPBANKSEL
![]()
![]()
#define STLINK_F_HAS_RW8_512BYTES
![]()
![]()
#define STLINK_F_HAS_TARGET_VOLT
![]()
![]()
#define STLINK_F_HAS_FPU_REG
![]()
![]()
#define STLINK_F_HAS_MEM_WR_NO_INC
![]()
![]()
#define STLINK_F_HAS_MEM_RD_NO_INC
![]()
![]()
#define STLINK_F_HAS_RW_MISC
![]()
![]()
#define STLINK_F_HAS_CSW
![]()
![]()
#define STLINK_REGSEL_IS_FPU
![]()
![]()
speed_map
![]()
![]()
speed
![]()
![]()
speed_divisor
![]()
![]()
stlink_khz_to_speed_map_swd
![]()
![]()
stlink_khz_to_speed_map_jtag
![]()
![]()
stlink_usb_block(void *)
![]()
![]()
sync_transfer_cb(struct libusb_transfer *)
![]()
![]()
sync_transfer_wait_for_completion(struct libusb_transfer *)
![]()
![]()
while
(!*completed)
![]()
![]()
if
(r < 0)
![]()
![]()
transfer_error_status(const struct libusb_transfer *)
![]()
![]()
switch
(transfer->status)
![]()
![]()
case
LIBUSB_TRANSFER_COMPLETED:
![]()
![]()
case
LIBUSB_TRANSFER_TIMED_OUT:
![]()
![]()
case
LIBUSB_TRANSFER_STALL:
![]()
![]()
case
LIBUSB_TRANSFER_OVERFLOW:
![]()
![]()
case
LIBUSB_TRANSFER_NO_DEVICE:
![]()
![]()
case
LIBUSB_TRANSFER_ERROR:
![]()
![]()
case
LIBUSB_TRANSFER_CANCELLED:
![]()
![]()
default
![]()
![]()
jtag_xfer
![]()
![]()
ep
![]()
![]()
buf
![]()
![]()
size
![]()
![]()
retval
![]()
![]()
completed
![]()
![]()
transfer_size
![]()
![]()
transfer
![]()
![]()
jtag_libusb_bulk_transfer_n(struct libusb_device_handle *, struct jtag_xfer *, size_t, int)
![]()
![]()
for
(size_t i = 0; i < n_transfers; ++i)
![]()
![]()
if
(!transfers[i].transfer)
![]()
![]()
for
(size_t i = 0; i < n_transfers; ++i)
![]()
![]()
if
(retval < 0)
![]()
![]()
for
(size_t i = 0; i < n_transfers; ++i)
![]()
![]()
if
(transfers[i].retval == 0)
![]()
![]()
if
(retval)
![]()
![]()
else
![]()
![]()
stlink_usb_xfer_v1_get_status(void *)
![]()
![]()
stlink_usb_xfer_rw(void *, int, const uint8_t *, int)
![]()
![]()
if
(h->direction == h->tx_ep && size)
![]()
![]()
else if
(h->direction == h->rx_ep && size)
![]()
![]()
stlink_usb_xfer_v1_get_sense(void *)
![]()
![]()
stlink_usb_usb_read_trace(void *, const uint8_t *, int)
![]()
![]()
if
(ret || tr != size)
![]()
![]()
stlink_usb_usb_xfer_noerrcheck(void *, const uint8_t *, int)
![]()
![]()
if
(h->version.stlink == 1)
![]()
![]()
if
(h->version.stlink == 1)
![]()
![]()
if
(stlink_usb_xfer_v1_get_status(handle) != ERROR_OK)
![]()
![]()
if
(h->cmdbuf[12] == 1)
![]()
![]()
stlink_tcp_send_cmd(void *, int, int, bool)
![]()
![]()
if
(sent_size != send_size)
![]()
![]()
while
(remaining_bytes > 0)
![]()
![]()
if
(timeval_ms() > timeout)
![]()
![]()
if
(received == -1)
![]()
![]()
if
(retval != ERROR_OK)
![]()
![]()
if
(check_tcp_status)
![]()
![]()
if
(tcp_ss != STLINK_TCP_SS_OK)
![]()
![]()
if
(tcp_ss == STLINK_TCP_SS_TCP_BUSY)
![]()
![]()
stlink_tcp_xfer_noerrcheck(void *, const uint8_t *, int)
![]()
![]()
if
(h->direction == h->tx_ep)
![]()
![]()
if
(send_size > STLINK_TCP_SEND_BUFFER_SIZE)
![]()
![]()
else
![]()
![]()
if
(recv_size > STLINK_TCP_RECV_BUFFER_SIZE)
![]()
![]()
if
(h->direction != h->tx_ep)
![]()
![]()
stlink_tcp_read_trace(void *, const uint8_t *, int)
![]()
![]()
stlink_usb_error_check(void *)
![]()
![]()
if
(h->st_mode == STLINK_MODE_DEBUG_SWIM)
![]()
![]()
switch
(h->databuf[0])
![]()
![]()
case
STLINK_SWIM_ERR_OK:
![]()
![]()
case
STLINK_SWIM_BUSY:
![]()
![]()
default
![]()
![]()
switch
(h->databuf[0])
![]()
![]()
case
STLINK_DEBUG_ERR_OK:
![]()
![]()
case
STLINK_DEBUG_ERR_FAULT:
![]()
![]()
case
STLINK_SWD_AP_WAIT:
![]()
![]()
case
STLINK_SWD_DP_WAIT:
![]()
![]()
case
STLINK_JTAG_GET_IDCODE_ERROR:
![]()
![]()
case
STLINK_JTAG_WRITE_ERROR:
![]()
![]()
case
STLINK_JTAG_WRITE_VERIF_ERROR:
![]()
![]()
case
STLINK_SWD_AP_FAULT:
![]()
![]()
case
STLINK_SWD_AP_ERROR:
![]()
![]()
case
STLINK_SWD_AP_PARITY_ERROR:
![]()
![]()
case
STLINK_SWD_DP_FAULT:
![]()
![]()
case
STLINK_SWD_DP_ERROR:
![]()
![]()
case
STLINK_SWD_DP_PARITY_ERROR:
![]()
![]()
case
STLINK_SWD_AP_WDATA_ERROR:
![]()
![]()
case
STLINK_SWD_AP_STICKY_ERROR:
![]()
![]()
case
STLINK_SWD_AP_STICKYORUN_ERROR:
![]()
![]()
case
STLINK_BAD_AP_ERROR:
![]()
![]()
default
![]()
![]()
stlink_usb_xfer_errcheck(void *, const uint8_t *, int)
![]()
![]()
stlink_cmd_allow_retry(void *, const uint8_t *, int)
![]()
![]()
while
(1)
![]()
![]()
if
((h->st_mode != STLINK_MODE_DEBUG_SWIM) || !retries)
![]()
![]()
if
(h->st_mode == STLINK_MODE_DEBUG_SWIM)
![]()
![]()
if
(res == ERROR_WAIT && retries < MAX_WAIT_RETRIES)
![]()
![]()
stlink_usb_read_trace(void *, const uint8_t *, int)
![]()
![]()
stlink_usb_set_cbw_transfer_datalength(void *, uint32_t)
![]()
![]()
stlink_usb_xfer_v1_create_cmd(void *, uint8_t, uint32_t)
![]()
![]()
stlink_usb_init_buffer(void *, uint8_t, uint32_t)
![]()
![]()
stlink_usb_version(void *)
![]()
![]()
switch
(h->pid)
![]()
![]()
case
STLINK_V2_1_PID:
![]()
![]()
case
STLINK_V2_1_NO_MSD_PID:
![]()
![]()
if
((x <= 22 && y == 7) || (x >= 25 && y >= 7 && y <= 12))
![]()
![]()
else
![]()
![]()
default
![]()
![]()
if
(v >= 3 && x == 0 && y == 0)
![]()
![]()
switch
(h->version.stlink)
![]()
![]()
case
1:
![]()
![]()
case
2:
![]()
![]()
if
(h->version.jtag >= 24)
![]()
![]()
case
3:
![]()
![]()
case
4:
![]()
![]()
default
![]()
![]()
stlink_usb_check_voltage(void *, float *)
![]()
![]()
stlink_usb_set_swdclk(void *, uint16_t)
![]()
![]()
stlink_usb_set_jtagclk(void *, uint16_t)
![]()
![]()
stlink_usb_current_mode(void *, uint8_t *)
![]()
![]()
stlink_usb_mode_enter(void *, enum stlink_mode)
![]()
![]()
switch
(type)
![]()
![]()
case
STLINK_MODE_DEBUG_JTAG:
![]()
![]()
case
STLINK_MODE_DEBUG_SWD:
![]()
![]()
case
STLINK_MODE_DEBUG_SWIM:
![]()
![]()
case
STLINK_MODE_DFU:
![]()
![]()
case
STLINK_MODE_MASS:
![]()
![]()
default
![]()
![]()
stlink_usb_mode_leave(void *, enum stlink_mode)
![]()
![]()
switch
(type)
![]()
![]()
case
STLINK_MODE_DEBUG_JTAG:
![]()
![]()
case
STLINK_MODE_DEBUG_SWD:
![]()
![]()
case
STLINK_MODE_DEBUG_SWIM:
![]()
![]()
case
STLINK_MODE_DFU:
![]()
![]()
case
STLINK_MODE_MASS:
![]()
![]()
default
![]()
![]()
stlink_get_mode(enum hl_transports)
![]()
![]()
switch
(t)
![]()
![]()
case
HL_TRANSPORT_SWD:
![]()
![]()
case
HL_TRANSPORT_JTAG:
![]()
![]()
default
![]()
![]()
stlink_usb_exit_mode(void *)
![]()
![]()
switch
(mode)
![]()
![]()
case
STLINK_DEV_DFU_MODE:
![]()
![]()
case
STLINK_DEV_DEBUG_MODE:
![]()
![]()
case
STLINK_DEV_SWIM_MODE:
![]()
![]()
case
STLINK_DEV_BOOTLOADER_MODE:
![]()
![]()
case
STLINK_DEV_MASS_MODE:
![]()
![]()
default
![]()
![]()
stlink_usb_init_mode(void *, bool, int)
![]()
![]()
if
(mode != STLINK_DEV_DFU_MODE)
![]()
![]()
if
(res != ERROR_OK)
![]()
![]()
else
![]()
![]()
if
(emode == STLINK_MODE_UNKNOWN)
![]()
![]()
if
(emode == STLINK_MODE_DEBUG_JTAG)
![]()
![]()
if
(h->version.flags & STLINK_F_HAS_JTAG_SET_FREQ)
![]()
![]()
else if
(emode == STLINK_MODE_DEBUG_SWD)
![]()
![]()
if
(h->version.flags & STLINK_F_HAS_SWD_SET_FREQ)
![]()
![]()
if
(h->version.jtag_api == STLINK_JTAG_API_V3 && (emode == STLINK_MODE_DEBUG_JTAG || emode == STLINK_MODE_DEBUG_SWD))
![]()
![]()
if
(connect_under_reset)
![]()
![]()
stlink_swim_status(void *)
![]()
![]()
stlink_swim_cap(void *, uint8_t *)
![]()
![]()
stlink_swim_assert_reset(void *, int)
![]()
![]()
stlink_swim_enter(void *)
![]()
![]()
stlink_swim_speed(void *, int)
![]()
![]()
stlink_swim_generate_rst(void *)
![]()
![]()
stlink_swim_resync(void *)
![]()
![]()
stlink_swim_writebytes(void *, uint32_t, uint32_t, const uint8_t *)
![]()
![]()
for
(i = 0; i < len; i++)
![]()
![]()
stlink_swim_readbytes(void *, uint32_t, uint32_t, uint8_t *)
![]()
![]()
stlink_usb_idcode(void *, uint32_t *)
![]()
![]()
if
(h->st_mode == STLINK_MODE_DEBUG_SWIM)
![]()
![]()
if
(h->version.jtag_api == STLINK_JTAG_API_V1)
![]()
![]()
else
![]()
![]()
stlink_usb_v2_read_debug_reg(void *, uint32_t, uint32_t *)
![]()
![]()
stlink_usb_write_debug_reg(void *, uint32_t, uint32_t)
![]()
![]()
stlink_usb_trace_read(void *, uint8_t *, size_t *)
![]()
![]()
if
(h->trace.enabled && (h->version.flags & STLINK_F_HAS_TRACE))
![]()
![]()
if
(*size > 0)
![]()
![]()
stlink_usb_v2_get_status(void *)
![]()
![]()
stlink_usb_state(void *)
![]()
![]()
if
(h->reconnect_pending)
![]()
![]()
if
(h->version.jtag_api != STLINK_JTAG_API_V1)
![]()
![]()
stlink_usb_assert_srst(void *, int)
![]()
![]()
stlink_usb_trace_disable(void *)
![]()
![]()
stlink_usb_trace_enable(void *)
![]()
![]()
if
(h->version.flags & STLINK_F_HAS_TRACE)
![]()
![]()
if
(res == ERROR_OK)
![]()
![]()
else
![]()
![]()
stlink_usb_reset(void *)
![]()
![]()
if
(h->trace.enabled)
![]()
![]()
stlink_usb_run(void *)
![]()
![]()
if
(h->version.jtag_api != STLINK_JTAG_API_V1)
![]()
![]()
stlink_usb_halt(void *)
![]()
![]()
if
(h->version.jtag_api != STLINK_JTAG_API_V1)
![]()
![]()
stlink_usb_step(void *)
![]()
![]()
if
(h->version.jtag_api != STLINK_JTAG_API_V1)
![]()
![]()
stlink_usb_read_regs(void *)
![]()
![]()
if
(h->version.jtag_api == STLINK_JTAG_API_V1)
![]()
![]()
else
![]()
![]()
stlink_usb_read_reg(void *, unsigned int, uint32_t *)
![]()
![]()
if
(STLINK_REGSEL_IS_FPU(regsel) && !(h->version.flags & STLINK_F_HAS_FPU_REG))
![]()
![]()
if
(h->version.jtag_api == STLINK_JTAG_API_V1)
![]()
![]()
else
![]()
![]()
stlink_usb_write_reg(void *, unsigned int, uint32_t)
![]()
![]()
if
(STLINK_REGSEL_IS_FPU(regsel) && !(h->version.flags & STLINK_F_HAS_FPU_REG))
![]()
![]()
stlink_usb_get_rw_status(void *)
![]()
![]()
if
(h->version.flags & STLINK_F_HAS_GETLASTRWSTATUS2)
![]()
![]()
else
![]()
![]()
stlink_usb_read_mem8(void *, uint8_t, uint32_t, uint32_t, uint16_t, uint8_t *)
![]()
![]()
if
(len > stlink_usb_block(h))
![]()
![]()
stlink_usb_write_mem8(void *, uint8_t, uint32_t, uint32_t, uint16_t, const uint8_t *)
![]()
![]()
if
(len > stlink_usb_block(h))
![]()
![]()
stlink_usb_read_mem16(void *, uint8_t, uint32_t, uint32_t, uint16_t, uint8_t *)
![]()
![]()
if
(len > STLINK_MAX_RW16_32)
![]()
![]()
if
(len % 2 || addr % 2)
![]()
![]()
stlink_usb_write_mem16(void *, uint8_t, uint32_t, uint32_t, uint16_t, const uint8_t *)
![]()
![]()
if
(len > STLINK_MAX_RW16_32)
![]()
![]()
if
(len % 2 || addr % 2)
![]()
![]()
stlink_usb_read_mem32(void *, uint8_t, uint32_t, uint32_t, uint16_t, uint8_t *)
![]()
![]()
if
(len > STLINK_MAX_RW16_32)
![]()
![]()
if
(len % 4 || addr % 4)
![]()
![]()
stlink_usb_write_mem32(void *, uint8_t, uint32_t, uint32_t, uint16_t, const uint8_t *)
![]()
![]()
if
(len > STLINK_MAX_RW16_32)
![]()
![]()
if
(len % 4 || addr % 4)
![]()
![]()
stlink_usb_read_mem32_noaddrinc(void *, uint8_t, uint32_t, uint32_t, uint16_t, uint8_t *)
![]()
![]()
if
(len > STLINK_MAX_RW16_32)
![]()
![]()
if
(len % 4 || addr % 4)
![]()
![]()
stlink_usb_write_mem32_noaddrinc(void *, uint8_t, uint32_t, uint32_t, uint16_t, const uint8_t *)
![]()
![]()
if
(len > STLINK_MAX_RW16_32)
![]()
![]()
if
(len % 4 || addr % 4)
![]()
![]()
stlink_max_block_size(uint32_t, uint32_t)
![]()
![]()
stlink_usb_read_ap_mem(void *, uint8_t, uint32_t, uint32_t, uint32_t, uint32_t, uint8_t *)
![]()
![]()
while
(count)
![]()
![]()
if
(size != 1)
![]()
![]()
if
(addr & (size - 1))
![]()
![]()
if
(retval == ERROR_WAIT && retries < MAX_WAIT_RETRIES)
![]()
![]()
else
![]()
![]()
if
(retval == ERROR_WAIT && retries < MAX_WAIT_RETRIES)
![]()
![]()
stlink_usb_read_mem(void *, uint32_t, uint32_t, uint32_t, uint8_t *)
![]()
![]()
stlink_usb_write_ap_mem(void *, uint8_t, uint32_t, uint32_t, uint32_t, uint32_t, const uint8_t *)
![]()
![]()
while
(count)
![]()
![]()
if
(size != 1)
![]()
![]()
if
(addr & (size - 1))
![]()
![]()
if
(retval == ERROR_WAIT && retries < MAX_WAIT_RETRIES)
![]()
![]()
if
(retval == ERROR_WAIT && retries < MAX_WAIT_RETRIES)
![]()
![]()
stlink_usb_write_mem(void *, uint32_t, uint32_t, uint32_t, const uint8_t *)
![]()
![]()
stlink_usb_override_target(const char *)
![]()
![]()
stlink_speed_swim(void *, int, bool)
![]()
![]()
if
(!query)
![]()
![]()
stlink_match_speed_map(const struct speed_map *, unsigned int, int, bool)
![]()
![]()
for
(i = 0; i < map_size; i++)
![]()
![]()
if
(khz == map[i].speed)
![]()
![]()
else
![]()
![]()
if
((current_diff < speed_diff) && khz >= map[i].speed)
![]()
![]()
if
(speed_index == -1)
![]()
![]()
if
(!match && query)
![]()
![]()
stlink_speed_swd(void *, int, bool)
![]()
![]()
if
(!query)
![]()
![]()
if
(result != ERROR_OK)
![]()
![]()
stlink_speed_jtag(void *, int, bool)
![]()
![]()
if
(!query)
![]()
![]()
if
(result != ERROR_OK)
![]()
![]()
stlink_dump_speed_map(const struct speed_map *, unsigned int)
![]()
![]()
stlink_get_com_freq(void *, bool, struct speed_map *)
![]()
![]()
if
(h->version.jtag_api != STLINK_JTAG_API_V3)
![]()
![]()
for
(i = 0; i < size; i++)
![]()
![]()
stlink_set_com_freq(void *, bool, unsigned int)
![]()
![]()
if
(h->version.jtag_api != STLINK_JTAG_API_V3)
![]()
![]()
stlink_speed_v3(void *, bool, int, bool)
![]()
![]()
if
(!query)
![]()
![]()
if
(result != ERROR_OK)
![]()
![]()
stlink_speed(void *, int, bool)
![]()
![]()
switch
(h->st_mode)
![]()
![]()
case
STLINK_MODE_DEBUG_SWIM:
![]()
![]()
case
STLINK_MODE_DEBUG_SWD:
![]()
![]()
case
STLINK_MODE_DEBUG_JTAG:
![]()
![]()
default
![]()
![]()
stlink_usb_usb_close(void *)
![]()
![]()
if
(h->usb_backend_priv.fd)
![]()
![]()
stlink_tcp_close(void *)
![]()
![]()
if
(h->tcp_backend_priv.connected)
![]()
![]()
if
(h->tcp_backend_priv.connect_id)
![]()
![]()
stlink_close(void *)
![]()
![]()
if
(handle)
![]()
![]()
stlink_usb_get_alternate_serial(struct libusb_device_handle *, struct libusb_device_descriptor *)
![]()
![]()
if
(usb_retval < LIBUSB_SUCCESS)
![]()
![]()
else if
(usb_retval < 4)
![]()
![]()
if
(usb_retval < LIBUSB_SUCCESS)
![]()
![]()
else if
(desc_serial[1] != LIBUSB_DT_STRING || len > usb_retval)
![]()
![]()
if
(len == ((STLINK_SERIAL_LEN + 1) * 2))
![]()
![]()
else if
(len != ((STLINK_SERIAL_LEN / 2 + 1) * 2))
![]()
![]()
stlink_usb_usb_open(void *, struct hl_interface_param *)
![]()
![]()
if
(jtag_libusb_open(param->vid, param->pid, NULL, &h->usb_backend_priv.fd, stlink_usb_get_alternate_serial) != ERROR_OK)
![]()
![]()
if
(libusb_claim_interface(h->usb_backend_priv.fd, 0) != ERROR_OK)
![]()
![]()
if
(jtag_libusb_get_pid(libusb_get_device(h->usb_backend_priv.fd), &pid) != ERROR_OK)
![]()
![]()
switch
(pid)
![]()
![]()
case
STLINK_V1_PID:
![]()
![]()
case
STLINK_V3_USBLOADER_PID:
![]()
![]()
case
STLINK_V3E_PID:
![]()
![]()
case
STLINK_V3S_PID:
![]()
![]()
case
STLINK_V3_2VCP_PID:
![]()
![]()
case
STLINK_V3E_NO_MSD_PID:
![]()
![]()
case
STLINK_V3P_USBLOADER_PID:
![]()
![]()
case
STLINK_V3P_PID:
![]()
![]()
case
STLINK_V2_1_PID:
![]()
![]()
case
STLINK_V2_1_NO_MSD_PID:
![]()
![]()
default
![]()
![]()
case
STLINK_V2_PID:
![]()
![]()
if
(err == ERROR_OK)
![]()
![]()
else if
(h->version.stlink == 1 || retry_count == 0)
![]()
![]()
else
![]()
![]()
if
(err != ERROR_OK)
![]()
![]()
if
(err != ERROR_OK)
![]()
![]()
stlink_tcp_open(void *, struct hl_interface_param *)
![]()
![]()
if
(h->st_mode == STLINK_MODE_DEBUG_SWIM)
![]()
![]()
if
(h->tcp_backend_priv.fd == -1)
![]()
![]()
if
(setsockopt(h->tcp_backend_priv.fd, IPPROTO_TCP, TCP_NODELAY, (const void *)&optval, sizeof(int)) == -1)
![]()
![]()
if
(setsockopt(h->tcp_backend_priv.fd, SOL_SOCKET, SO_RCVBUF, (const void *)&optval, sizeof(int)) == -1)
![]()
![]()
if
(setsockopt(h->tcp_backend_priv.fd, SOL_SOCKET, SO_SNDBUF, (const void *)&optval, sizeof(int)) == -1)
![]()
![]()
if
(connect(h->tcp_backend_priv.fd, (const struct sockaddr *)&serv, sizeof(serv)) == -1)
![]()
![]()
if
(ret != ERROR_OK)
![]()
![]()
if
(connected_stlinks == 0)
![]()
![]()
if
(connected_stlinks > 255)
![]()
![]()
for
(uint32_t stlink_id = 0; stlink_id < connected_stlinks; stlink_id++)
![]()
![]()
for
(int i = 0; param->vid[i]; i++)
![]()
![]()
if
(param->vid[i] == h->vid && param->pid[i] == h->pid)
![]()
![]()
if
(adapter_serial)
![]()
![]()
if
(strlen(adapter_serial) == STLINK_SERIAL_LEN / 2)
![]()
![]()
else
![]()
![]()
if
(!stlink_id_matched)
![]()
![]()
if
(!stlink_serial_matched)
![]()
![]()
if
(stlink_used)
![]()
![]()
stlink_usb_backend
![]()
![]()
stlink_tcp_backend
![]()
![]()
stlink_open(struct hl_interface_param *, enum stlink_mode, void **)
![]()
![]()
if
(!h)
![]()
![]()
for
(unsigned i = 0; param->vid[i]; i++)
![]()
![]()
switch
(h->st_mode)
![]()
![]()
case
STLINK_MODE_DEBUG_SWD:
![]()
![]()
case
STLINK_MODE_DEBUG_JTAG:
![]()
![]()
case
STLINK_MODE_DEBUG_SWIM:
![]()
![]()
default
![]()
![]()
if
(err != ERROR_OK)
![]()
![]()
if
(err != ERROR_OK)
![]()
![]()
if
(h->st_mode == STLINK_MODE_DEBUG_SWIM)
![]()
![]()
if
(err != ERROR_OK)
![]()
![]()
if
(h->max_mem_packet == 0)
![]()
![]()
if
(err == ERROR_OK)
![]()
![]()
if
(i == 4 || i == 3)
![]()
![]()
stlink_usb_hl_open(struct hl_interface_param *, void **)
![]()
![]()
stlink_config_trace(void *, bool, enum tpiu_pin_protocol, uint32_t, unsigned int *, unsigned int, uint16_t *)
![]()
![]()
if
(!(h->version.flags & STLINK_F_HAS_TRACE))
![]()
![]()
if
(!enabled)
![]()
![]()
if
(pin_protocol != TPIU_PIN_PROTOCOL_ASYNC_UART)
![]()
![]()
if
(*trace_freq > max_trace_freq)
![]()
![]()
if
(presc == 0 || presc > TPIU_ACPR_MAX_SWOSCALER + 1)
![]()
![]()
if
(presc * *trace_freq < traceclkin_freq - max_deviation || presc * *trace_freq > traceclkin_freq + max_deviation)
![]()
![]()
stlink_usb_init_access_port(void *, unsigned char)
![]()
![]()
stlink_usb_close_access_port(void *, unsigned char)
![]()
![]()
stlink_usb_rw_misc_out(void *, uint32_t, const uint8_t *)
![]()
![]()
stlink_usb_rw_misc_in(void *, uint32_t, uint8_t *)
![]()
![]()
stlink_read_dap_register(void *, unsigned short, unsigned short, uint32_t *)
![]()
![]()
stlink_write_dap_register(void *, unsigned short, unsigned short, uint32_t)
![]()
![]()
stlink_usb_layout_api
![]()
![]()
stlink_dap_handle
![]()
![]()
stlink_dap_param
![]()
![]()
opened_ap
![]()
![]()
last_csw_default
![]()
![]()
stlink_dap_error
![]()
![]()
stlink_dap_record_error(int)
![]()
![]()
stlink_dap_get_and_clear_error()
![]()
![]()
stlink_dap_get_error()
![]()
![]()
stlink_usb_open_ap(void *, unsigned short)
![]()
![]()
stlink_dap_open_ap(unsigned short)
![]()
![]()
stlink_dap_closeall_ap()
![]()
![]()
for
(apsel = 0; apsel <= DP_APSEL_MAX; apsel++)
![]()
![]()
stlink_dap_reinit_interface()
![]()
![]()
if
(!stlink_dap_handle->reconnect_pending)
![]()
![]()
if
(test_bit(apsel, opened_ap))
![]()
![]()
stlink_dap_op_connect(struct adiv5_dap *)
![]()
![]()
if
(!dap->do_reconnect)
![]()
![]()
if
(jtag_reset_config & RESET_CNCT_UNDER_SRST)
![]()
![]()
if
(retval != ERROR_OK)
![]()
![]()
stlink_dap_check_reconnect(struct adiv5_dap *)
![]()
![]()
stlink_dap_op_send_sequence(struct adiv5_dap *, enum swd_special_seq)
![]()
![]()
stlink_dap_dp_read(struct adiv5_dap *, unsigned int, uint32_t *)
![]()
![]()
if
(reg & 0x000000F0)
![]()
![]()
if
(stlink_dap_handle->version.flags & STLINK_F_QUIRK_JTAG_DP_READ && stlink_dap_handle->st_mode == STLINK_MODE_DEBUG_JTAG)
![]()
![]()
else
![]()
![]()
stlink_dap_dp_write(struct adiv5_dap *, unsigned int, uint32_t)
![]()
![]()
if
(reg & 0x000000F0)
![]()
![]()
if
(reg == DP_SELECT && (data & DP_SELECT_DPBANK) != 0)
![]()
![]()
stlink_dap_ap_read(struct adiv5_ap *, unsigned int, uint32_t *)
![]()
![]()
if
(is_adiv6(dap))
![]()
![]()
if
(reg != ADIV5_AP_REG_IDR)
![]()
![]()
stlink_dap_ap_write(struct adiv5_ap *, unsigned int, uint32_t)
![]()
![]()
if
(is_adiv6(dap))
![]()
![]()
stlink_dap_op_queue_ap_abort(struct adiv5_dap *, uint8_t *)
![]()
![]()
#define RW_MISC_CMD_ADDRESS
![]()
![]()
#define RW_MISC_CMD_WRITE
![]()
![]()
#define RW_MISC_CMD_READ
![]()
![]()
#define RW_MISC_CMD_APNUM
![]()
![]()
stlink_usb_misc_rw_segment(void *, const struct dap_queue *, unsigned int, unsigned int)
![]()
![]()
for
(unsigned int i = 0; i < len; i++)
![]()
![]()
if
(ap_num != q[i].mem_ap.ap->ap_num)
![]()
![]()
switch
(q[i].cmd)
![]()
![]()
case
CMD_MEM_AP_READ32:
![]()
![]()
case
CMD_MEM_AP_WRITE32:
![]()
![]()
default
![]()
![]()
for
(unsigned int i = 0; i < len; i++)
![]()
![]()
if
(errcode != STLINK_DEBUG_ERR_OK)
![]()
![]()
if
(ap_num != q[i].mem_ap.ap->ap_num)
![]()
![]()
if
(errcode != STLINK_DEBUG_ERR_OK)
![]()
![]()
if
(q[i].cmd == CMD_MEM_AP_READ32)
![]()
![]()
else
![]()
![]()
if
(errcode != STLINK_DEBUG_ERR_OK)
![]()
![]()
stlink_usb_buf_rw_segment(void *, const struct dap_queue *, unsigned int)
![]()
![]()
switch
(q[0].cmd)
![]()
![]()
case
CMD_MEM_AP_WRITE8:
![]()
![]()
case
CMD_MEM_AP_WRITE16:
![]()
![]()
case
CMD_MEM_AP_WRITE32:
![]()
![]()
case
CMD_MEM_AP_READ8:
![]()
![]()
case
CMD_MEM_AP_READ16:
![]()
![]()
case
CMD_MEM_AP_READ32:
![]()
![]()
default
![]()
![]()
#define STLINK_V2_RW_MISC_SIZE
![]()
![]()
#define STLINK_V3_RW_MISC_SIZE
![]()
![]()
stlink_usb_count_misc_rw_queue(void *, const struct dap_queue *, unsigned int, unsigned int *)
![]()
![]()
for
(i = 0; i < len; i++)
![]()
![]()
if
(ap_num != q[i].mem_ap.ap->ap_num)
![]()
![]()
stlink_usb_count_buf_rw_queue(const struct dap_queue *, unsigned int)
![]()
![]()
stlink_usb_mem_rw_queue(void *, const struct dap_queue *, unsigned int, unsigned int *)
![]()
![]()
if
(count_misc > count_buf)
![]()
![]()
else
![]()
![]()
stlink_dap_run_internal(struct adiv5_dap *)
![]()
![]()
if
(retval != ERROR_OK)
![]()
![]()
while
(i && stlink_dap_get_error() == ERROR_OK)
![]()
![]()
switch
(q->cmd)
![]()
![]()
case
CMD_DP_READ:
![]()
![]()
case
CMD_DP_WRITE:
![]()
![]()
case
CMD_AP_READ:
![]()
![]()
case
CMD_AP_WRITE:
![]()
![]()
case
CMD_MEM_AP_READ8:
![]()
![]()
case
CMD_MEM_AP_READ16:
![]()
![]()
case
CMD_MEM_AP_READ32:
![]()
![]()
case
CMD_MEM_AP_WRITE8:
![]()
![]()
case
CMD_MEM_AP_WRITE16:
![]()
![]()
case
CMD_MEM_AP_WRITE32:
![]()
![]()
default
![]()
![]()
stlink_dap_run_finalize(struct adiv5_dap *)
![]()
![]()
if
(dap->stlink_flush_ap_write)
![]()
![]()
if
(retval != ERROR_OK)
![]()
![]()
if
(retval != ERROR_OK)
![]()
![]()
if
(ctrlstat & SSTICKYERR)
![]()
![]()
if
(retval != ERROR_OK)
![]()
![]()
stlink_dap_op_queue_run(struct adiv5_dap *)
![]()
![]()
stlink_dap_op_quit(struct adiv5_dap *)
![]()
![]()
stlink_dap_op_queue_dp_read(struct adiv5_dap *, unsigned int, uint32_t *)
![]()
![]()
stlink_dap_op_queue_dp_write(struct adiv5_dap *, unsigned int, uint32_t)
![]()
![]()
stlink_dap_op_queue_ap_read(struct adiv5_ap *, unsigned int, uint32_t *)
![]()
![]()
if
((stlink_dap_handle->version.flags & STLINK_F_HAS_CSW) && (reg == ADIV5_MEM_AP_REG_DRW || reg == ADIV5_MEM_AP_REG_BD0 || reg == ADIV5_MEM_AP_REG_BD1 || reg == ADIV5_MEM_AP_REG_BD2 || reg == ADIV5_MEM_AP_REG_BD3))
![]()
![]()
if
(i && prev_q->cmd == CMD_AP_WRITE && prev_q->ap_w.ap == ap && prev_q->ap_w.reg == ADIV5_MEM_AP_REG_TAR)
![]()
![]()
if
(i && prev_q->cmd == CMD_AP_WRITE && prev_q->ap_w.ap == ap && prev_q->ap_w.reg == ADIV5_MEM_AP_REG_CSW && !prev_q->ap_w.changes_csw_default)
![]()
![]()
switch
(ap->csw_value & CSW_SIZE_MASK)
![]()
![]()
case
CSW_8BIT:
![]()
![]()
case
CSW_16BIT:
![]()
![]()
case
CSW_32BIT:
![]()
![]()
default
![]()
![]()
else
![]()
![]()
stlink_dap_op_queue_ap_write(struct adiv5_ap *, unsigned int, uint32_t)
![]()
![]()
if
((stlink_dap_handle->version.flags & STLINK_F_HAS_CSW) && (reg == ADIV5_MEM_AP_REG_DRW || reg == ADIV5_MEM_AP_REG_BD0 || reg == ADIV5_MEM_AP_REG_BD1 || reg == ADIV5_MEM_AP_REG_BD2 || reg == ADIV5_MEM_AP_REG_BD3))
![]()
![]()
if
(i && prev_q->cmd == CMD_AP_WRITE && prev_q->ap_w.ap == ap && prev_q->ap_w.reg == ADIV5_MEM_AP_REG_TAR)
![]()
![]()
if
(i && prev_q->cmd == CMD_AP_WRITE && prev_q->ap_w.ap == ap && prev_q->ap_w.reg == ADIV5_MEM_AP_REG_CSW && !prev_q->ap_w.changes_csw_default)
![]()
![]()
switch
(ap->csw_value & CSW_SIZE_MASK)
![]()
![]()
case
CSW_8BIT:
![]()
![]()
case
CSW_16BIT:
![]()
![]()
case
CSW_32BIT:
![]()
![]()
default
![]()
![]()
else
![]()
![]()
if
(reg == ADIV5_MEM_AP_REG_CSW && ap->csw_default != last_csw_default[ap_num])
![]()
![]()
else
![]()
![]()
stlink_swim_op_srst()
![]()
![]()
stlink_swim_op_read_mem(uint32_t, uint32_t, uint32_t, uint8_t *)
![]()
![]()
while
(count)
![]()
![]()
stlink_swim_op_write_mem(uint32_t, uint32_t, uint32_t, const uint8_t *)
![]()
![]()
while
(count)
![]()
![]()
stlink_swim_op_reconnect()
![]()
![]()
stlink_dap_config_trace(bool, enum tpiu_pin_protocol, uint32_t, unsigned int *, unsigned int, uint16_t *)
![]()
![]()
stlink_dap_trace_read(uint8_t *, size_t *)
![]()
![]()
stlink_dap_vid_pid(struct command_invocation *)
![]()
![]()
if
(CMD_ARGC > max_usb_ids * 2)
![]()
![]()
if
(CMD_ARGC < 2 || (CMD_ARGC & 1))
![]()
![]()
for
(i = 0; i < CMD_ARGC; i += 2)
![]()
![]()
stlink_dap_backend_command(struct command_invocation *)
![]()
![]()
else if
(strcmp(CMD_ARGV[0], "usb") == 0)
![]()
![]()
else if
(strcmp(CMD_ARGV[0], "tcp") == 0)
![]()
![]()
#define BYTES_PER_LINE
![]()
![]()
stlink_dap_cmd_command(struct command_invocation *)
![]()
![]()
if
(tx_n > STLINK_SG_SIZE || rx_n > STLINK_DATA_SIZE)
![]()
![]()
for
(unsigned int i = 0; i < tx_n; i++)
![]()
![]()
if
(retval != ERROR_OK)
![]()
![]()
stlink_dap_subcommand_handlers
![]()
![]()
stlink_dap_command_handlers
![]()
![]()
stlink_dap_init()
![]()
![]()
if
(jtag_reset_config & RESET_CNCT_UNDER_SRST)
![]()
![]()
else
![]()
![]()
if
((mode != STLINK_MODE_DEBUG_SWIM) && !(stlink_dap_handle->version.flags & STLINK_F_HAS_DAP_REG))
![]()
![]()
stlink_dap_quit()
![]()
![]()
stlink_dap_reset(int, int)
![]()
![]()
stlink_dap_speed(int)
![]()
![]()
if
(speed == 0)
![]()
![]()
stlink_dap_khz(int, int *)
![]()
![]()
if
(khz == 0)
![]()
![]()
stlink_dap_speed_div(int, int *)
![]()
![]()
stlink_dap_ops
![]()
![]()
stlink_swim_ops
![]()
![]()
stlink_dap_transport
![]()
![]()
stlink_dap_adapter_driver