OpenOCD
|
Go to the source code of this file.
Data Structures | |
struct | dap_queue |
struct | speed_map |
struct | stlink_backend_s |
struct | stlink_tcp_priv_s |
struct | stlink_tcp_version |
struct | stlink_usb_handle_s |
struct | stlink_usb_priv_s |
struct | stlink_usb_version |
Enumerations | |
enum | queue_cmd { CMD_DP_READ = 1 , CMD_DP_WRITE , CMD_AP_READ , CMD_AP_WRITE , CMD_MEM_AP_READ8 = 0x10 + 1 , CMD_MEM_AP_READ16 = 0x10 + 2 , CMD_MEM_AP_READ32 = 0x10 + 4 , CMD_MEM_AP_WRITE8 = 0x20 + 1 , CMD_MEM_AP_WRITE16 = 0x20 + 2 , CMD_MEM_AP_WRITE32 = 0x20 + 4 } |
enum | stlink_jtag_api_version { STLINK_JTAG_API_V1 = 1 , STLINK_JTAG_API_V2 , STLINK_JTAG_API_V3 } |
enum | stlink_mode { STLINK_MODE_UNKNOWN = 0 , STLINK_MODE_DFU , STLINK_MODE_MASS , STLINK_MODE_DEBUG_JTAG , STLINK_MODE_DEBUG_SWD , STLINK_MODE_DEBUG_SWIM } |
Functions | |
__attribute__ ((unused)) | |
COMMAND_HANDLER (stlink_dap_backend_command) | |
COMMAND_HANDLER (stlink_dap_cmd_command) | |
COMMAND_HANDLER (stlink_dap_vid_pid) | |
static | DECLARE_BITMAP (opened_ap, DP_APSEL_MAX+1) |
static int | stlink_close (void *handle) |
static int | stlink_cmd_allow_retry (void *handle, const uint8_t *buf, int size) |
Issue an STLINK command via USB transfer, with retries on any wait status responses. More... | |
static int | stlink_config_trace (void *handle, bool enabled, enum tpiu_pin_protocol pin_protocol, uint32_t port_size, unsigned int *trace_freq, unsigned int traceclkin_freq, uint16_t *prescaler) |
static int | stlink_dap_ap_read (struct adiv5_ap *ap, unsigned int reg, uint32_t *data) |
static int | stlink_dap_ap_write (struct adiv5_ap *ap, unsigned int reg, uint32_t data) |
static int | stlink_dap_check_reconnect (struct adiv5_dap *dap) |
static int | stlink_dap_closeall_ap (void) |
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) |
static int | stlink_dap_dp_read (struct adiv5_dap *dap, unsigned int reg, uint32_t *data) |
static int | stlink_dap_dp_write (struct adiv5_dap *dap, unsigned int reg, uint32_t data) |
static int | stlink_dap_get_and_clear_error (void) |
static int | stlink_dap_get_error (void) |
static int | stlink_dap_init (void) |
static int | stlink_dap_khz (int khz, int *jtag_speed) |
static int | stlink_dap_op_connect (struct adiv5_dap *dap) |
static int | stlink_dap_op_queue_ap_abort (struct adiv5_dap *dap, uint8_t *ack) |
static int | stlink_dap_op_queue_ap_read (struct adiv5_ap *ap, unsigned int reg, uint32_t *data) |
static int | stlink_dap_op_queue_ap_write (struct adiv5_ap *ap, unsigned int reg, uint32_t data) |
static int | stlink_dap_op_queue_dp_read (struct adiv5_dap *dap, unsigned int reg, uint32_t *data) |
static int | stlink_dap_op_queue_dp_write (struct adiv5_dap *dap, unsigned int reg, uint32_t data) |
static int | stlink_dap_op_queue_run (struct adiv5_dap *dap) |
static void | stlink_dap_op_quit (struct adiv5_dap *dap) |
static int | stlink_dap_op_send_sequence (struct adiv5_dap *dap, enum swd_special_seq seq) |
static int | stlink_dap_open_ap (unsigned short apsel) |
static int | stlink_dap_quit (void) |
static int | stlink_dap_record_error (int error) |
static int | stlink_dap_reinit_interface (void) |
static int | stlink_dap_reset (int req_trst, int req_srst) |
static int | stlink_dap_run_finalize (struct adiv5_dap *dap) |
static void | stlink_dap_run_internal (struct adiv5_dap *dap) |
static int | stlink_dap_speed (int speed) |
static int | stlink_dap_speed_div (int speed, int *khz) |
static int | stlink_dap_trace_read (uint8_t *buf, size_t *size) |
static void | stlink_dump_speed_map (const struct speed_map *map, unsigned int map_size) |
static int | stlink_get_com_freq (void *handle, bool is_jtag, struct speed_map *map) |
static enum stlink_mode | stlink_get_mode (enum hl_transports t) |
static int | stlink_match_speed_map (const struct speed_map *map, unsigned int map_size, int khz, bool query) |
static uint32_t | stlink_max_block_size (uint32_t tar_autoincr_block, uint32_t address) |
static int | stlink_open (struct hl_interface_param_s *param, enum stlink_mode mode, void **fd) |
static int | stlink_read_dap_register (void *handle, unsigned short dap_port, unsigned short addr, uint32_t *val) |
static int | stlink_set_com_freq (void *handle, bool is_jtag, unsigned int frequency) |
static int | stlink_speed (void *handle, int khz, bool query) |
static int | stlink_speed_jtag (void *handle, int khz, bool query) |
static int | stlink_speed_swd (void *handle, int khz, bool query) |
static int | stlink_speed_swim (void *handle, int khz, bool query) |
static int | stlink_speed_v3 (void *handle, bool is_jtag, int khz, bool query) |
static int | stlink_swim_assert_reset (void *handle, int reset) |
static int | stlink_swim_enter (void *handle) |
static int | stlink_swim_generate_rst (void *handle) |
static int | stlink_swim_op_read_mem (uint32_t addr, uint32_t size, uint32_t count, uint8_t *buffer) |
static int | stlink_swim_op_reconnect (void) |
static int | stlink_swim_op_srst (void) |
static int | stlink_swim_op_write_mem (uint32_t addr, uint32_t size, uint32_t count, const uint8_t *buffer) |
static int | stlink_swim_readbytes (void *handle, uint32_t addr, uint32_t len, uint8_t *data) |
static int | stlink_swim_resync (void *handle) |
static int | stlink_swim_speed (void *handle, int speed) |
static int | stlink_swim_status (void *handle) |
static int | stlink_swim_writebytes (void *handle, uint32_t addr, uint32_t len, const uint8_t *data) |
static int | stlink_tcp_close (void *handle) |
static int | stlink_tcp_open (void *handle, struct hl_interface_param_s *param) |
static int | stlink_tcp_read_trace (void *handle, const uint8_t *buf, int size) |
static int | stlink_tcp_send_cmd (void *handle, int send_size, int recv_size, bool check_tcp_status) |
static int | stlink_tcp_xfer_noerrcheck (void *handle, const uint8_t *buf, int size) |
static int | stlink_usb_assert_srst (void *handle, int srst) |
static unsigned int | stlink_usb_block (void *handle) |
static int | stlink_usb_buf_rw_segment (void *handle, const struct dap_queue *q, unsigned int count) |
static int | stlink_usb_check_voltage (void *handle, float *target_voltage) |
static int | stlink_usb_close (void *handle) |
static int | stlink_usb_close_access_port (void *handle, unsigned char ap_num) |
static int | stlink_usb_count_buf_rw_queue (const struct dap_queue *q, unsigned int len) |
static int | stlink_usb_count_misc_rw_queue (void *handle, const struct dap_queue *q, unsigned int len, unsigned int *pkt_items) |
static int | stlink_usb_current_mode (void *handle, uint8_t *mode) |
static int | stlink_usb_error_check (void *handle) |
Converts an STLINK status code held in the first byte of a response to an openocd error, logs any error/wait status as debug output. More... | |
static int | stlink_usb_exit_mode (void *handle) |
static char * | stlink_usb_get_alternate_serial (struct libusb_device_handle *device, struct libusb_device_descriptor *dev_desc) |
static int | stlink_usb_get_rw_status (void *handle) |
static int | stlink_usb_halt (void *handle) |
static int | stlink_usb_hl_open (struct hl_interface_param_s *param, void **fd) |
static int | stlink_usb_idcode (void *handle, uint32_t *idcode) |
static int | stlink_usb_init_access_port (void *handle, unsigned char ap_num) |
static void | stlink_usb_init_buffer (void *handle, uint8_t direction, uint32_t size) |
static int | stlink_usb_init_mode (void *handle, bool connect_under_reset, int initial_interface_speed) |
static int | stlink_usb_mem_rw_queue (void *handle, const struct dap_queue *q, unsigned int len, unsigned int *skip) |
static int | stlink_usb_misc_rw_segment (void *handle, const struct dap_queue *q, unsigned int len, unsigned int items) |
static int | stlink_usb_mode_enter (void *handle, enum stlink_mode type) |
static int | stlink_usb_mode_leave (void *handle, enum stlink_mode type) |
static int | stlink_usb_open (void *handle, struct hl_interface_param_s *param) |
static int | stlink_usb_open_ap (void *handle, unsigned short apsel) |
static int | stlink_usb_override_target (const char *targetname) |
static int | stlink_usb_read_ap_mem (void *handle, uint8_t ap_num, uint32_t csw, uint32_t addr, uint32_t size, uint32_t count, uint8_t *buffer) |
static int | stlink_usb_read_mem (void *handle, uint32_t addr, uint32_t size, uint32_t count, uint8_t *buffer) |
static int | stlink_usb_read_mem16 (void *handle, uint8_t ap_num, uint32_t csw, uint32_t addr, uint16_t len, uint8_t *buffer) |
static int | stlink_usb_read_mem32 (void *handle, uint8_t ap_num, uint32_t csw, uint32_t addr, uint16_t len, uint8_t *buffer) |
static int | stlink_usb_read_mem32_noaddrinc (void *handle, uint8_t ap_num, uint32_t csw, uint32_t addr, uint16_t len, uint8_t *buffer) |
static int | stlink_usb_read_mem8 (void *handle, uint8_t ap_num, uint32_t csw, uint32_t addr, uint16_t len, uint8_t *buffer) |
static int | stlink_usb_read_reg (void *handle, unsigned int regsel, uint32_t *val) |
static int | stlink_usb_read_regs (void *handle) |
static int | stlink_usb_read_trace (void *handle, const uint8_t *buf, int size) |
static int | stlink_usb_reset (void *handle) |
static int | stlink_usb_run (void *handle) |
static int | stlink_usb_rw_misc_in (void *handle, uint32_t items, uint8_t *buffer) |
static int | stlink_usb_rw_misc_out (void *handle, uint32_t items, const uint8_t *buffer) |
static void | stlink_usb_set_cbw_transfer_datalength (void *handle, uint32_t size) |
static int | stlink_usb_set_jtagclk (void *handle, uint16_t clk_divisor) |
static int | stlink_usb_set_swdclk (void *handle, uint16_t clk_divisor) |
static enum target_state | stlink_usb_state (void *handle) |
static int | stlink_usb_step (void *handle) |
static void | stlink_usb_trace_disable (void *handle) |
static int | stlink_usb_trace_enable (void *handle) |
static int | stlink_usb_trace_read (void *handle, uint8_t *buf, size_t *size) |
static int | stlink_usb_usb_close (void *handle) |
static int | stlink_usb_usb_open (void *handle, struct hl_interface_param_s *param) |
static int | stlink_usb_usb_read_trace (void *handle, const uint8_t *buf, int size) |
static int | stlink_usb_usb_xfer_noerrcheck (void *handle, const uint8_t *buf, int size) |
static enum target_state | stlink_usb_v2_get_status (void *handle) |
static int | stlink_usb_v2_read_debug_reg (void *handle, uint32_t addr, uint32_t *val) |
static int | stlink_usb_version (void *handle) |
static int | stlink_usb_write_ap_mem (void *handle, uint8_t ap_num, uint32_t csw, uint32_t addr, uint32_t size, uint32_t count, const uint8_t *buffer) |
static int | stlink_usb_write_debug_reg (void *handle, uint32_t addr, uint32_t val) |
static int | stlink_usb_write_mem (void *handle, uint32_t addr, uint32_t size, uint32_t count, const uint8_t *buffer) |
static int | stlink_usb_write_mem16 (void *handle, uint8_t ap_num, uint32_t csw, uint32_t addr, uint16_t len, const uint8_t *buffer) |
static int | stlink_usb_write_mem32 (void *handle, uint8_t ap_num, uint32_t csw, uint32_t addr, uint16_t len, const uint8_t *buffer) |
static int | stlink_usb_write_mem32_noaddrinc (void *handle, uint8_t ap_num, uint32_t csw, uint32_t addr, uint16_t len, const uint8_t *buffer) |
static int | stlink_usb_write_mem8 (void *handle, uint8_t ap_num, uint32_t csw, uint32_t addr, uint16_t len, const uint8_t *buffer) |
static int | stlink_usb_write_reg (void *handle, unsigned int regsel, uint32_t val) |
static int | stlink_usb_xfer_errcheck (void *handle, const uint8_t *buf, int size) |
static int | stlink_usb_xfer_noerrcheck (void *handle, const uint8_t *buf, int size) |
static int | stlink_usb_xfer_rw (void *handle, int cmdsize, const uint8_t *buf, int size) |
static void | stlink_usb_xfer_v1_create_cmd (void *handle, uint8_t direction, uint32_t size) |
static int | stlink_usb_xfer_v1_get_sense (void *handle) |
static int | stlink_usb_xfer_v1_get_status (void *handle) |
static int | stlink_write_dap_register (void *handle, unsigned short dap_port, unsigned short addr, uint32_t val) |
Variables | |
static uint32_t | last_csw_default [DP_APSEL_MAX+1] |
struct adapter_driver | stlink_dap_adapter_driver |
static const struct command_registration | stlink_dap_command_handlers [] |
static int | stlink_dap_error = ERROR_OK |
static struct stlink_usb_handle_s * | stlink_dap_handle |
static const struct dap_ops | stlink_dap_ops |
static struct hl_interface_param_s | stlink_dap_param |
static const struct command_registration | stlink_dap_subcommand_handlers [] |
static const char *const | stlink_dap_transport [] = { "dapdirect_swd", "dapdirect_jtag", "swim", NULL } |
static const struct speed_map | stlink_khz_to_speed_map_jtag [] |
static const struct speed_map | stlink_khz_to_speed_map_swd [] |
static const struct swim_driver | stlink_swim_ops |
static struct stlink_backend_s | stlink_tcp_backend |
static struct stlink_backend_s | stlink_usb_backend |
struct hl_layout_api_s | stlink_usb_layout_api |
#define BYTES_PER_LINE 16 |
Definition at line 4999 of file stlink_usb.c.
Definition at line 207 of file stlink_usb.c.
#define ENDPOINT_IN 0x80 |
Definition at line 60 of file stlink_usb.c.
#define ENDPOINT_OUT 0x00 |
Definition at line 61 of file stlink_usb.c.
#define MAX_QUEUE_DEPTH (4096) |
Definition at line 185 of file stlink_usb.c.
#define MAX_WAIT_RETRIES 8 |
Definition at line 106 of file stlink_usb.c.
#define OPENOCD_STLINK_TCP_API_VERSION 1 |
Definition at line 476 of file stlink_usb.c.
#define REQUEST_SENSE 0x03 |
Definition at line 462 of file stlink_usb.c.
#define REQUEST_SENSE_LENGTH 18 |
Definition at line 463 of file stlink_usb.c.
#define RW_MISC_CMD_ADDRESS 1 |
Definition at line 4329 of file stlink_usb.c.
#define RW_MISC_CMD_APNUM 5 |
Definition at line 4332 of file stlink_usb.c.
#define RW_MISC_CMD_READ 3 |
Definition at line 4331 of file stlink_usb.c.
#define RW_MISC_CMD_WRITE 2 |
Definition at line 4330 of file stlink_usb.c.
#define STLINK_APIV3_GET_COM_FREQ 0x62 |
Definition at line 446 of file stlink_usb.c.
#define STLINK_APIV3_GET_VERSION_EX 0xFB |
Definition at line 448 of file stlink_usb.c.
#define STLINK_APIV3_SET_COM_FREQ 0x61 |
Definition at line 445 of file stlink_usb.c.
#define STLINK_BAD_AP_ERROR 0x1d |
Definition at line 334 of file stlink_usb.c.
#define STLINK_CMD_SIZE_V1 (10) |
Definition at line 76 of file stlink_usb.c.
#define STLINK_CMD_SIZE_V2 (16) |
Definition at line 75 of file stlink_usb.c.
#define STLINK_CORE_HALTED 0x81 |
Definition at line 337 of file stlink_usb.c.
#define STLINK_CORE_RUNNING 0x80 |
Definition at line 336 of file stlink_usb.c.
#define STLINK_CORE_STAT_UNKNOWN -1 |
Definition at line 338 of file stlink_usb.c.
#define STLINK_DATA_SIZE (6144) |
Definition at line 74 of file stlink_usb.c.
#define STLINK_DEBUG_APIV1_CLEARFP 0x0e |
Definition at line 400 of file stlink_usb.c.
#define STLINK_DEBUG_APIV1_ENTER 0x20 |
Definition at line 408 of file stlink_usb.c.
#define STLINK_DEBUG_APIV1_READALLREGS 0x04 |
Definition at line 390 of file stlink_usb.c.
#define STLINK_DEBUG_APIV1_READREG 0x05 |
Definition at line 391 of file stlink_usb.c.
#define STLINK_DEBUG_APIV1_RESETSYS 0x03 |
Definition at line 389 of file stlink_usb.c.
#define STLINK_DEBUG_APIV1_SETFP 0x0b |
Definition at line 397 of file stlink_usb.c.
#define STLINK_DEBUG_APIV1_SETWATCHPOINT 0x10 |
Definition at line 402 of file stlink_usb.c.
#define STLINK_DEBUG_APIV1_WRITEDEBUGREG 0x0f |
Definition at line 401 of file stlink_usb.c.
#define STLINK_DEBUG_APIV1_WRITEREG 0x06 |
Definition at line 392 of file stlink_usb.c.
#define STLINK_DEBUG_APIV2_CLOSE_AP_DBG 0x4C |
Definition at line 437 of file stlink_usb.c.
#define STLINK_DEBUG_APIV2_DRIVE_NRST 0x3C |
Definition at line 422 of file stlink_usb.c.
#define STLINK_DEBUG_APIV2_DRIVE_NRST_HIGH 0x01 |
Definition at line 451 of file stlink_usb.c.
#define STLINK_DEBUG_APIV2_DRIVE_NRST_LOW 0x00 |
Definition at line 450 of file stlink_usb.c.
#define STLINK_DEBUG_APIV2_DRIVE_NRST_PULSE 0x02 |
Definition at line 452 of file stlink_usb.c.
#define STLINK_DEBUG_APIV2_ENTER 0x30 |
Definition at line 412 of file stlink_usb.c.
#define STLINK_DEBUG_APIV2_GET_TRACE_NB 0x42 |
Definition at line 428 of file stlink_usb.c.
#define STLINK_DEBUG_APIV2_GETLASTRWSTATUS 0x3B |
Definition at line 421 of file stlink_usb.c.
#define STLINK_DEBUG_APIV2_GETLASTRWSTATUS2 0x3E |
Definition at line 424 of file stlink_usb.c.
#define STLINK_DEBUG_APIV2_INIT_AP 0x4B |
Definition at line 436 of file stlink_usb.c.
#define STLINK_DEBUG_APIV2_JTAG_SET_FREQ 0x44 |
Definition at line 430 of file stlink_usb.c.
#define STLINK_DEBUG_APIV2_READ_DAP_REG 0x45 |
Definition at line 431 of file stlink_usb.c.
#define STLINK_DEBUG_APIV2_READ_IDCODES 0x31 |
Definition at line 413 of file stlink_usb.c.
#define STLINK_DEBUG_APIV2_READALLREGS 0x3A |
Definition at line 420 of file stlink_usb.c.
#define STLINK_DEBUG_APIV2_READDEBUGREG 0x36 |
Definition at line 418 of file stlink_usb.c.
#define STLINK_DEBUG_APIV2_READMEM_16BIT 0x47 |
Definition at line 433 of file stlink_usb.c.
#define STLINK_DEBUG_APIV2_READREG 0x33 |
Definition at line 415 of file stlink_usb.c.
#define STLINK_DEBUG_APIV2_RESETSYS 0x32 |
Definition at line 414 of file stlink_usb.c.
#define STLINK_DEBUG_APIV2_RW_MISC_IN 0x52 |
Definition at line 441 of file stlink_usb.c.
#define STLINK_DEBUG_APIV2_RW_MISC_OUT 0x51 |
Definition at line 440 of file stlink_usb.c.
#define STLINK_DEBUG_APIV2_START_TRACE_RX 0x40 |
Definition at line 426 of file stlink_usb.c.
#define STLINK_DEBUG_APIV2_STOP_TRACE_RX 0x41 |
Definition at line 427 of file stlink_usb.c.
#define STLINK_DEBUG_APIV2_SWD_SET_FREQ 0x43 |
Definition at line 429 of file stlink_usb.c.
#define STLINK_DEBUG_APIV2_WRITE_DAP_REG 0x46 |
Definition at line 432 of file stlink_usb.c.
#define STLINK_DEBUG_APIV2_WRITEDEBUGREG 0x35 |
Definition at line 417 of file stlink_usb.c.
#define STLINK_DEBUG_APIV2_WRITEMEM_16BIT 0x48 |
Definition at line 434 of file stlink_usb.c.
#define STLINK_DEBUG_APIV2_WRITEREG 0x34 |
Definition at line 416 of file stlink_usb.c.
#define STLINK_DEBUG_COMMAND 0xF2 |
Definition at line 341 of file stlink_usb.c.
#define STLINK_DEBUG_ENTER_JTAG_NO_RESET 0xa4 |
Definition at line 406 of file stlink_usb.c.
#define STLINK_DEBUG_ENTER_JTAG_RESET 0x00 |
Definition at line 404 of file stlink_usb.c.
#define STLINK_DEBUG_ENTER_SWD_NO_RESET 0xa3 |
Definition at line 405 of file stlink_usb.c.
#define STLINK_DEBUG_ERR_FAULT 0x81 |
Definition at line 317 of file stlink_usb.c.
#define STLINK_DEBUG_ERR_OK 0x80 |
Definition at line 316 of file stlink_usb.c.
#define STLINK_DEBUG_EXIT 0x21 |
Definition at line 409 of file stlink_usb.c.
#define STLINK_DEBUG_FORCEDEBUG 0x02 |
Definition at line 388 of file stlink_usb.c.
#define STLINK_DEBUG_GETSTATUS 0x01 |
Definition at line 387 of file stlink_usb.c.
#define STLINK_DEBUG_PORT_ACCESS 0xffff |
Definition at line 454 of file stlink_usb.c.
#define STLINK_DEBUG_READCOREID 0x22 |
Definition at line 410 of file stlink_usb.c.
#define STLINK_DEBUG_READMEM_32BIT 0x07 |
Definition at line 393 of file stlink_usb.c.
#define STLINK_DEBUG_READMEM_32BIT_NO_ADDR_INC 0x54 |
Definition at line 443 of file stlink_usb.c.
#define STLINK_DEBUG_READMEM_8BIT 0x0c |
Definition at line 398 of file stlink_usb.c.
#define STLINK_DEBUG_RUNCORE 0x09 |
Definition at line 395 of file stlink_usb.c.
#define STLINK_DEBUG_STEPCORE 0x0a |
Definition at line 396 of file stlink_usb.c.
#define STLINK_DEBUG_WRITEMEM_32BIT 0x08 |
Definition at line 394 of file stlink_usb.c.
#define STLINK_DEBUG_WRITEMEM_32BIT_NO_ADDR_INC 0x50 |
Definition at line 439 of file stlink_usb.c.
#define STLINK_DEBUG_WRITEMEM_8BIT 0x0d |
Definition at line 399 of file stlink_usb.c.
#define STLINK_DEV_BOOTLOADER_MODE 0x04 |
Definition at line 351 of file stlink_usb.c.
#define STLINK_DEV_DEBUG_MODE 0x02 |
Definition at line 349 of file stlink_usb.c.
#define STLINK_DEV_DFU_MODE 0x00 |
Definition at line 347 of file stlink_usb.c.
#define STLINK_DEV_MASS_MODE 0x01 |
Definition at line 348 of file stlink_usb.c.
#define STLINK_DEV_SWIM_MODE 0x03 |
Definition at line 350 of file stlink_usb.c.
#define STLINK_DEV_UNKNOWN_MODE -1 |
Definition at line 352 of file stlink_usb.c.
#define STLINK_DFU_COMMAND 0xF3 |
Definition at line 342 of file stlink_usb.c.
#define STLINK_DFU_EXIT 0x07 |
Definition at line 354 of file stlink_usb.c.
#define STLINK_F_FIX_CLOSE_AP BIT(8) /* v2>=j29 || v3 */ |
Definition at line 512 of file stlink_usb.c.
#define STLINK_F_HAS_AP_INIT BIT(7) /* v2>=j28 || v3 */ |
Definition at line 511 of file stlink_usb.c.
#define STLINK_F_HAS_CSW STLINK_F_HAS_DPBANKSEL |
Definition at line 522 of file stlink_usb.c.
#define STLINK_F_HAS_DAP_REG BIT(5) /* v2>=j24 || v3 */ |
Definition at line 509 of file stlink_usb.c.
#define STLINK_F_HAS_DPBANKSEL BIT(9) /* v2>=j32 || v3>=j2 */ |
Definition at line 513 of file stlink_usb.c.
#define STLINK_F_HAS_FPU_REG STLINK_F_HAS_GETLASTRWSTATUS2 |
Definition at line 518 of file stlink_usb.c.
#define STLINK_F_HAS_GETLASTRWSTATUS2 BIT(1) /* v2>=j15 || v3 */ |
Definition at line 505 of file stlink_usb.c.
#define STLINK_F_HAS_JTAG_SET_FREQ BIT(3) /* v2>=j24 */ |
Definition at line 507 of file stlink_usb.c.
#define STLINK_F_HAS_MEM_16BIT BIT(6) /* v2>=j26 || v3 */ |
Definition at line 510 of file stlink_usb.c.
#define STLINK_F_HAS_MEM_RD_NO_INC STLINK_F_HAS_DPBANKSEL |
Definition at line 520 of file stlink_usb.c.
#define STLINK_F_HAS_MEM_WR_NO_INC STLINK_F_HAS_MEM_16BIT |
Definition at line 519 of file stlink_usb.c.
#define STLINK_F_HAS_RW8_512BYTES BIT(10) /* v3>=j6 */ |
Definition at line 514 of file stlink_usb.c.
#define STLINK_F_HAS_RW_MISC STLINK_F_HAS_DPBANKSEL |
Definition at line 521 of file stlink_usb.c.
#define STLINK_F_HAS_SWD_SET_FREQ BIT(2) /* v2>=j22 */ |
Definition at line 506 of file stlink_usb.c.
#define STLINK_F_HAS_TARGET_VOLT STLINK_F_HAS_TRACE |
Definition at line 517 of file stlink_usb.c.
#define STLINK_F_HAS_TRACE BIT(0) /* v2>=j13 || v3 */ |
Definition at line 504 of file stlink_usb.c.
#define STLINK_F_QUIRK_JTAG_DP_READ BIT(4) /* v2>=j24 && v2<j32 */ |
Definition at line 508 of file stlink_usb.c.
#define STLINK_GET_CURRENT_MODE 0xF5 |
Definition at line 344 of file stlink_usb.c.
#define STLINK_GET_TARGET_VOLTAGE 0xF7 |
Definition at line 345 of file stlink_usb.c.
#define STLINK_GET_VERSION 0xF1 |
Definition at line 340 of file stlink_usb.c.
#define STLINK_HLA_AP_NUM 0 |
Definition at line 109 of file stlink_usb.c.
#define STLINK_HLA_CSW 0 |
Definition at line 110 of file stlink_usb.c.
#define STLINK_JTAG_GET_IDCODE_ERROR 0x09 |
Definition at line 322 of file stlink_usb.c.
#define STLINK_JTAG_WRITE_ERROR 0x0c |
Definition at line 323 of file stlink_usb.c.
#define STLINK_JTAG_WRITE_VERIF_ERROR 0x0d |
Definition at line 324 of file stlink_usb.c.
#define STLINK_MAX_RW16_32 STLINK_DATA_SIZE |
Definition at line 100 of file stlink_usb.c.
#define STLINK_MAX_RW8 (64) |
Definition at line 98 of file stlink_usb.c.
#define STLINK_READ_TIMEOUT (LIBUSB_TIMEOUT_MS) |
Definition at line 64 of file stlink_usb.c.
#define STLINK_REGSEL_IS_FPU | ( | x | ) | ((x) > 0x1F) |
Definition at line 524 of file stlink_usb.c.
#define STLINK_RX_EP (1|ENDPOINT_IN) |
Definition at line 66 of file stlink_usb.c.
#define STLINK_SERIAL_LEN 24 |
Definition at line 58 of file stlink_usb.c.
#define STLINK_SG_SIZE (31) |
Definition at line 73 of file stlink_usb.c.
#define STLINK_SWD_AP_ERROR 0x12 |
Definition at line 320 of file stlink_usb.c.
#define STLINK_SWD_AP_FAULT 0x11 |
Definition at line 319 of file stlink_usb.c.
#define STLINK_SWD_AP_PARITY_ERROR 0x13 |
Definition at line 321 of file stlink_usb.c.
#define STLINK_SWD_AP_STICKY_ERROR 0x19 |
Definition at line 331 of file stlink_usb.c.
#define STLINK_SWD_AP_STICKYORUN_ERROR 0x1a |
Definition at line 332 of file stlink_usb.c.
#define STLINK_SWD_AP_WAIT 0x10 |
Definition at line 318 of file stlink_usb.c.
#define STLINK_SWD_AP_WDATA_ERROR 0x18 |
Definition at line 330 of file stlink_usb.c.
#define STLINK_SWD_DP_ERROR 0x16 |
Definition at line 327 of file stlink_usb.c.
#define STLINK_SWD_DP_FAULT 0x15 |
Definition at line 326 of file stlink_usb.c.
#define STLINK_SWD_DP_PARITY_ERROR 0x17 |
Definition at line 328 of file stlink_usb.c.
#define STLINK_SWD_DP_WAIT 0x14 |
Definition at line 325 of file stlink_usb.c.
#define STLINK_SWIM_ASSERT_RESET 0x07 |
Definition at line 380 of file stlink_usb.c.
#define STLINK_SWIM_BUSY 0x01 |
Definition at line 315 of file stlink_usb.c.
#define STLINK_SWIM_COMMAND 0xF4 |
Definition at line 343 of file stlink_usb.c.
#define STLINK_SWIM_DATA_SIZE STLINK_DATA_SIZE |
Definition at line 101 of file stlink_usb.c.
#define STLINK_SWIM_DEASSERT_RESET 0x08 |
Definition at line 381 of file stlink_usb.c.
#define STLINK_SWIM_ENTER 0x00 |
Definition at line 373 of file stlink_usb.c.
#define STLINK_SWIM_ENTER_SEQ 0x04 |
Definition at line 377 of file stlink_usb.c.
#define STLINK_SWIM_ERR_OK 0x00 |
Definition at line 314 of file stlink_usb.c.
#define STLINK_SWIM_EXIT 0x01 |
Definition at line 374 of file stlink_usb.c.
#define STLINK_SWIM_GEN_RST 0x05 |
Definition at line 378 of file stlink_usb.c.
#define STLINK_SWIM_READ_CAP 0x02 |
Definition at line 375 of file stlink_usb.c.
#define STLINK_SWIM_READBUF 0x0c |
Definition at line 385 of file stlink_usb.c.
#define STLINK_SWIM_READMEM 0x0b |
Definition at line 384 of file stlink_usb.c.
#define STLINK_SWIM_READSTATUS 0x09 |
Definition at line 382 of file stlink_usb.c.
#define STLINK_SWIM_RESET 0x06 |
Definition at line 379 of file stlink_usb.c.
#define STLINK_SWIM_SPEED 0x03 |
Definition at line 376 of file stlink_usb.c.
#define STLINK_SWIM_WRITEMEM 0x0a |
Definition at line 383 of file stlink_usb.c.
#define STLINK_TCP_CMD_CLOSE_DEV 0x04 |
Definition at line 470 of file stlink_usb.c.
#define STLINK_TCP_CMD_GET_DEV_INFO 0x02 |
Definition at line 468 of file stlink_usb.c.
#define STLINK_TCP_CMD_GET_NB_DEV 0x01 |
Definition at line 467 of file stlink_usb.c.
#define STLINK_TCP_CMD_GET_NB_OF_DEV_CLIENTS 0x07 |
Definition at line 473 of file stlink_usb.c.
#define STLINK_TCP_CMD_GET_SERVER_VERSION 0x06 |
Definition at line 472 of file stlink_usb.c.
#define STLINK_TCP_CMD_OPEN_DEV 0x03 |
Definition at line 469 of file stlink_usb.c.
#define STLINK_TCP_CMD_REFRESH_DEVICE_LIST 0x00 |
Definition at line 466 of file stlink_usb.c.
#define STLINK_TCP_CMD_SEND_USB_CMD 0x05 |
Definition at line 471 of file stlink_usb.c.
#define STLINK_TCP_RECV_BUFFER_SIZE 10240 |
Definition at line 484 of file stlink_usb.c.
#define STLINK_TCP_REQUEST_READ 1 |
Definition at line 478 of file stlink_usb.c.
#define STLINK_TCP_REQUEST_READ_SWO 3 |
Definition at line 479 of file stlink_usb.c.
#define STLINK_TCP_REQUEST_WRITE 0 |
Definition at line 477 of file stlink_usb.c.
#define STLINK_TCP_SEND_BUFFER_SIZE 10240 |
Definition at line 483 of file stlink_usb.c.
#define STLINK_TCP_SERIAL_SIZE 32 |
Definition at line 482 of file stlink_usb.c.
#define STLINK_TCP_SS_BAD_PARAMETER 0x00001002 |
Definition at line 490 of file stlink_usb.c.
#define STLINK_TCP_SS_CMD_NOT_AVAILABLE 0x00001053 |
Definition at line 493 of file stlink_usb.c.
#define STLINK_TCP_SS_MEMORY_PROBLEM 0x00001000 |
Definition at line 488 of file stlink_usb.c.
#define STLINK_TCP_SS_OK 0x00000001 |
Definition at line 487 of file stlink_usb.c.
#define STLINK_TCP_SS_OPEN_ERR 0x00001003 |
Definition at line 491 of file stlink_usb.c.
#define STLINK_TCP_SS_SIZE 4 |
Definition at line 480 of file stlink_usb.c.
#define STLINK_TCP_SS_TCP_BUSY 0x00002004 |
Definition at line 497 of file stlink_usb.c.
#define STLINK_TCP_SS_TCP_CANT_CONNECT 0x00002002 |
Definition at line 495 of file stlink_usb.c.
#define STLINK_TCP_SS_TCP_CLOSE_ERROR 0x00002003 |
Definition at line 496 of file stlink_usb.c.
#define STLINK_TCP_SS_TCP_ERROR 0x00002001 |
Definition at line 494 of file stlink_usb.c.
#define STLINK_TCP_SS_TIMEOUT 0x00001001 |
Definition at line 489 of file stlink_usb.c.
#define STLINK_TCP_SS_TRUNCATED_DATA 0x00001052 |
Definition at line 492 of file stlink_usb.c.
#define STLINK_TCP_SS_WIN32_ERROR 0x00010000 |
Definition at line 498 of file stlink_usb.c.
#define STLINK_TCP_USB_CMD_SIZE 32 |
Definition at line 481 of file stlink_usb.c.
#define STLINK_TRACE_EP (3|ENDPOINT_IN) |
Definition at line 68 of file stlink_usb.c.
#define STLINK_TRACE_MAX_HZ 2000000 |
Definition at line 457 of file stlink_usb.c.
#define STLINK_TRACE_SIZE 4096 |
Definition at line 456 of file stlink_usb.c.
#define STLINK_TX_EP (2|ENDPOINT_OUT) |
Definition at line 67 of file stlink_usb.c.
#define STLINK_V1_PID (0x3744) |
Definition at line 78 of file stlink_usb.c.
#define STLINK_V2_1_NO_MSD_PID (0x3752) |
Definition at line 81 of file stlink_usb.c.
#define STLINK_V2_1_PID (0x374B) |
Definition at line 80 of file stlink_usb.c.
#define STLINK_V2_1_TRACE_EP (2|ENDPOINT_IN) |
Definition at line 71 of file stlink_usb.c.
#define STLINK_V2_1_TX_EP (1|ENDPOINT_OUT) |
Definition at line 70 of file stlink_usb.c.
#define STLINK_V2_PID (0x3748) |
Definition at line 79 of file stlink_usb.c.
#define STLINK_V2_RW_MISC_SIZE (64) |
Definition at line 4481 of file stlink_usb.c.
#define STLINK_V3_2VCP_PID (0x3753) |
Definition at line 85 of file stlink_usb.c.
#define STLINK_V3_MAX_FREQ_NB 10 |
Definition at line 460 of file stlink_usb.c.
#define STLINK_V3_RW_MISC_SIZE (1227) |
Definition at line 4482 of file stlink_usb.c.
#define STLINK_V3_TRACE_MAX_HZ 24000000 |
Definition at line 458 of file stlink_usb.c.
#define STLINK_V3_USBLOADER_PID (0x374D) |
Definition at line 82 of file stlink_usb.c.
#define STLINK_V3E_NO_MSD_PID (0x3754) |
Definition at line 86 of file stlink_usb.c.
#define STLINK_V3E_PID (0x374E) |
Definition at line 83 of file stlink_usb.c.
#define STLINK_V3S_PID (0x374F) |
Definition at line 84 of file stlink_usb.c.
#define STLINK_WRITE_TIMEOUT (LIBUSB_TIMEOUT_MS) |
Definition at line 63 of file stlink_usb.c.
#define STLINKV3_MAX_RW8 (512) |
Definition at line 99 of file stlink_usb.c.
enum queue_cmd |
Enumerator | |
---|---|
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 |
Definition at line 187 of file stlink_usb.c.
Enumerator | |
---|---|
STLINK_JTAG_API_V1 | |
STLINK_JTAG_API_V2 | |
STLINK_JTAG_API_V3 |
Definition at line 112 of file stlink_usb.c.
enum stlink_mode |
Enumerator | |
---|---|
STLINK_MODE_UNKNOWN | |
STLINK_MODE_DFU | |
STLINK_MODE_MASS | |
STLINK_MODE_DEBUG_JTAG | |
STLINK_MODE_DEBUG_SWD | |
STLINK_MODE_DEBUG_SWIM |
Definition at line 118 of file stlink_usb.c.
__attribute__ | ( | (unused) | ) |
Definition at line 1812 of file stlink_usb.c.
References stlink_usb_handle_s::cmdbuf, stlink_usb_handle_s::cmdidx, stlink_usb_handle_s::databuf, ERROR_OK, stlink_usb_handle_s::rx_ep, STLINK_SWIM_COMMAND, STLINK_SWIM_READ_CAP, stlink_usb_init_buffer(), and stlink_usb_xfer_noerrcheck().
COMMAND_HANDLER | ( | stlink_dap_backend_command | ) |
Definition at line 4974 of file stlink_usb.c.
References CMD_ARGC, CMD_ARGV, COMMAND_PARSE_NUMBER, ERROR_COMMAND_SYNTAX_ERROR, ERROR_OK, stlink_dap_param, hl_interface_param_s::stlink_tcp_port, and hl_interface_param_s::use_stlink_tcp.
COMMAND_HANDLER | ( | stlink_dap_cmd_command | ) |
Definition at line 5000 of file stlink_usb.c.
References BYTES_PER_LINE, CMD, CMD_ARGC, CMD_ARGV, stlink_usb_handle_s::cmdbuf, stlink_usb_handle_s::cmdidx, COMMAND_PARSE_NUMBER, command_print_sameline(), stlink_usb_handle_s::databuf, ERROR_COMMAND_SYNTAX_ERROR, ERROR_OK, LOG_ERROR, stlink_usb_handle_s::rx_ep, stlink_dap_handle, STLINK_DATA_SIZE, STLINK_SG_SIZE, stlink_usb_init_buffer(), and stlink_usb_xfer_noerrcheck().
COMMAND_HANDLER | ( | stlink_dap_vid_pid | ) |
Definition at line 4949 of file stlink_usb.c.
References CMD_ARGC, CMD_ARGV, COMMAND_PARSE_NUMBER, ERROR_COMMAND_SYNTAX_ERROR, ERROR_OK, HLA_MAX_USB_IDS, LOG_WARNING, hl_interface_param_s::pid, stlink_dap_param, and hl_interface_param_s::vid.
|
static |
|
static |
Definition at line 3258 of file stlink_usb.c.
References ERROR_OK, and stlink_usb_close().
Referenced by stlink_dap_quit(), and stlink_open().
|
static |
Issue an STLINK command via USB transfer, with retries on any wait status responses.
Works for commands where the STLINK_DEBUG status is returned in the first byte of the response packet. For SWIM a SWIM_READSTATUS is requested instead.
Returns an openocd result code.
Definition at line 1159 of file stlink_usb.c.
References delay_us(), ERROR_OK, ERROR_WAIT, LOG_DEBUG, MAX_WAIT_RETRIES, size, stlink_usb_handle_s::st_mode, STLINK_MODE_DEBUG_SWIM, stlink_swim_status(), stlink_usb_error_check(), and stlink_usb_xfer_noerrcheck().
Referenced by stlink_swim_assert_reset(), stlink_swim_enter(), stlink_swim_generate_rst(), stlink_swim_readbytes(), stlink_swim_resync(), stlink_swim_speed(), stlink_swim_writebytes(), stlink_usb_assert_srst(), stlink_usb_halt(), stlink_usb_mode_enter(), stlink_usb_read_reg(), stlink_usb_reset(), stlink_usb_run(), stlink_usb_set_jtagclk(), stlink_usb_set_swdclk(), stlink_usb_step(), stlink_usb_v2_read_debug_reg(), stlink_usb_write_debug_reg(), and stlink_usb_write_reg().
|
static |
Definition at line 3798 of file stlink_usb.c.
References stlink_usb_handle_s::enabled, ERROR_FAIL, ERROR_OK, stlink_usb_version::flags, LOG_ERROR, stlink_usb_handle_s::source_hz, stlink_usb_version::stlink, STLINK_F_HAS_TRACE, STLINK_TRACE_MAX_HZ, stlink_usb_trace_disable(), stlink_usb_trace_enable(), STLINK_V3_TRACE_MAX_HZ, TPIU_ACPR_MAX_SWOSCALER, TPIU_PIN_PROTOCOL_ASYNC_UART, stlink_usb_handle_s::trace, and stlink_usb_handle_s::version.
Referenced by stlink_dap_config_trace().
|
static |
Definition at line 4272 of file stlink_usb.c.
References ADIV5_AP_REG_IDR, adiv5_dap::ap, adiv5_ap::ap_num, adiv5_ap::dap, dummy, ERROR_FAIL, ERROR_OK, is_adiv6(), LOG_ERROR, stlink_dap_handle, stlink_dap_open_ap(), adiv5_dap::stlink_flush_ap_write, and stlink_read_dap_register().
Referenced by stlink_dap_run_internal().
|
static |
Definition at line 4299 of file stlink_usb.c.
References adiv5_dap::ap, adiv5_ap::ap_num, adiv5_ap::dap, ERROR_FAIL, ERROR_OK, is_adiv6(), LOG_ERROR, stlink_dap_handle, stlink_dap_open_ap(), adiv5_dap::stlink_flush_ap_write, and stlink_write_dap_register().
Referenced by stlink_dap_run_internal().
|
static |
Definition at line 4195 of file stlink_usb.c.
References adiv5_dap::do_reconnect, ERROR_OK, stlink_dap_op_connect(), and stlink_dap_reinit_interface().
Referenced by stlink_dap_run_internal().
|
static |
Definition at line 4100 of file stlink_usb.c.
References clear_bit(), DP_APSEL_MAX, ERROR_OK, stlink_usb_version::flags, stlink_dap_handle, STLINK_F_HAS_AP_INIT, stlink_usb_close_access_port(), test_bit(), and stlink_usb_handle_s::version.
Referenced by stlink_dap_op_quit().
|
static |
Definition at line 4933 of file stlink_usb.c.
References stlink_config_trace(), and stlink_dap_handle.
|
static |
Definition at line 4217 of file stlink_usb.c.
References DP_RDBUFF, dummy, ERROR_COMMAND_NOTFOUND, ERROR_OK, stlink_usb_version::flags, LOG_ERROR, stlink_usb_handle_s::st_mode, stlink_dap_handle, STLINK_DEBUG_PORT_ACCESS, STLINK_F_HAS_DPBANKSEL, STLINK_F_QUIRK_JTAG_DP_READ, STLINK_MODE_DEBUG_JTAG, stlink_read_dap_register(), and stlink_usb_handle_s::version.
Referenced by stlink_dap_run_finalize(), and stlink_dap_run_internal().
|
static |
Definition at line 4246 of file stlink_usb.c.
References CORUNDETECT, DP_CTRL_STAT, DP_SELECT, DP_SELECT_DPBANK, ERROR_COMMAND_NOTFOUND, stlink_usb_version::flags, LOG_DEBUG, LOG_ERROR, stlink_dap_handle, STLINK_DEBUG_PORT_ACCESS, STLINK_F_HAS_DPBANKSEL, stlink_write_dap_register(), and stlink_usb_handle_s::version.
Referenced by stlink_dap_run_finalize(), and stlink_dap_run_internal().
|
static |
Definition at line 4057 of file stlink_usb.c.
References ERROR_OK, and stlink_dap_error.
Referenced by stlink_dap_run_finalize().
|
static |
Definition at line 4064 of file stlink_usb.c.
References stlink_dap_error.
Referenced by stlink_dap_op_queue_ap_read(), stlink_dap_op_queue_ap_write(), stlink_dap_op_queue_dp_read(), stlink_dap_op_queue_dp_write(), and stlink_dap_run_internal().
|
static |
Definition at line 5075 of file stlink_usb.c.
References hl_interface_param_s::connect_under_reset, ERROR_FAIL, ERROR_OK, stlink_usb_version::flags, jtag_get_reset_config(), jtag_reset_config, LOG_DEBUG, LOG_ERROR, LOG_WARNING, mode, RESET_CNCT_UNDER_SRST, RESET_SRST_NO_GATING, stlink_dap_handle, stlink_dap_param, STLINK_F_HAS_DAP_REG, STLINK_MODE_DEBUG_JTAG, STLINK_MODE_DEBUG_SWD, STLINK_MODE_DEBUG_SWIM, stlink_open(), transport_is_dapdirect_jtag(), transport_is_dapdirect_swd(), transport_is_swim(), and stlink_usb_handle_s::version.
|
static |
Definition at line 5144 of file stlink_usb.c.
References ERROR_FAIL, ERROR_OK, LOG_ERROR, stlink_dap_handle, and stlink_speed().
|
static |
Definition at line 4153 of file stlink_usb.c.
References adapter_assert_reset(), dap_dp_init(), dap_invalidate_cache(), adiv5_dap::do_reconnect, DP_APSEL_MAX, ERROR_OK, jtag_get_reset_config(), jtag_reset_config, last_csw_default, LOG_INFO, LOG_WARNING, RESET_CNCT_UNDER_SRST, RESET_SRST_NO_GATING, stlink_usb_handle_s::st_mode, stlink_dap_handle, STLINK_MODE_DEBUG_JTAG, and stlink_usb_idcode().
Referenced by stlink_dap_check_reconnect().
|
static |
Definition at line 4323 of file stlink_usb.c.
References ERROR_OK, and LOG_WARNING.
|
static |
Definition at line 4732 of file stlink_usb.c.
References ADIV5_MEM_AP_REG_BD0, ADIV5_MEM_AP_REG_BD1, ADIV5_MEM_AP_REG_BD2, ADIV5_MEM_AP_REG_BD3, ADIV5_MEM_AP_REG_CSW, ADIV5_MEM_AP_REG_DRW, ADIV5_MEM_AP_REG_TAR, dap_queue::ap, dap_queue::ap_r, dap_queue::ap_w, dap_queue::cmd, CMD_AP_READ, CMD_AP_WRITE, CMD_MEM_AP_READ16, CMD_MEM_AP_READ32, CMD_MEM_AP_READ8, CSW_16BIT, CSW_32BIT, CSW_8BIT, adiv5_ap::csw_default, CSW_SIZE_MASK, adiv5_ap::csw_value, adiv5_ap::dap, dap_queue::data, ERROR_FAIL, ERROR_OK, stlink_usb_version::flags, LOG_ERROR, MAX_QUEUE_DEPTH, dap_queue::mem_ap, stlink_usb_handle_s::queue, stlink_usb_handle_s::queue_index, dap_queue::reg, stlink_dap_get_error(), stlink_dap_handle, stlink_dap_record_error(), stlink_dap_run_internal(), STLINK_F_HAS_CSW, adiv5_ap::tar_valid, adiv5_ap::tar_value, and stlink_usb_handle_s::version.
|
static |
Definition at line 4798 of file stlink_usb.c.
References ADIV5_MEM_AP_REG_BD0, ADIV5_MEM_AP_REG_BD1, ADIV5_MEM_AP_REG_BD2, ADIV5_MEM_AP_REG_BD3, ADIV5_MEM_AP_REG_CSW, ADIV5_MEM_AP_REG_DRW, ADIV5_MEM_AP_REG_TAR, dap_queue::ap, adiv5_ap::ap_num, dap_queue::ap_w, dap_queue::cmd, CMD_AP_WRITE, CMD_MEM_AP_WRITE16, CMD_MEM_AP_WRITE32, CMD_MEM_AP_WRITE8, CSW_16BIT, CSW_32BIT, CSW_8BIT, adiv5_ap::csw_default, CSW_SIZE_MASK, adiv5_ap::csw_value, adiv5_ap::dap, dap_queue::data, ERROR_FAIL, ERROR_OK, stlink_usb_version::flags, last_csw_default, LOG_ERROR, MAX_QUEUE_DEPTH, dap_queue::mem_ap, stlink_usb_handle_s::queue, stlink_usb_handle_s::queue_index, dap_queue::reg, stlink_dap_get_error(), stlink_dap_handle, stlink_dap_record_error(), stlink_dap_run_internal(), STLINK_F_HAS_CSW, adiv5_ap::tar_valid, adiv5_ap::tar_value, and stlink_usb_handle_s::version.
|
static |
Definition at line 4694 of file stlink_usb.c.
References dap_queue::cmd, CMD_DP_READ, dap_queue::dap, dap_queue::data, dap_queue::dp_r, ERROR_OK, MAX_QUEUE_DEPTH, stlink_usb_handle_s::queue, stlink_usb_handle_s::queue_index, dap_queue::reg, stlink_dap_get_error(), stlink_dap_handle, and stlink_dap_run_internal().
|
static |
Definition at line 4713 of file stlink_usb.c.
References dap_queue::cmd, CMD_DP_WRITE, dap_queue::dap, dap_queue::data, dap_queue::dp_w, ERROR_OK, MAX_QUEUE_DEPTH, stlink_usb_handle_s::queue, stlink_usb_handle_s::queue_index, dap_queue::reg, stlink_dap_get_error(), stlink_dap_handle, and stlink_dap_run_internal().
|
static |
Definition at line 4678 of file stlink_usb.c.
References dap_queue::dap, stlink_dap_run_finalize(), and stlink_dap_run_internal().
|
static |
Definition at line 4685 of file stlink_usb.c.
References ERROR_OK, LOG_ERROR, and stlink_dap_closeall_ap().
|
static |
Definition at line 4210 of file stlink_usb.c.
References ERROR_OK.
|
static |
Definition at line 4094 of file stlink_usb.c.
References stlink_dap_handle, and stlink_usb_open_ap().
Referenced by stlink_dap_ap_read(), stlink_dap_ap_write(), stlink_dap_reinit_interface(), and stlink_usb_buf_rw_segment().
|
static |
Definition at line 5114 of file stlink_usb.c.
References LOG_DEBUG, stlink_close(), and stlink_dap_handle.
|
static |
Definition at line 4049 of file stlink_usb.c.
References ERROR_OK, and stlink_dap_error.
Referenced by stlink_dap_op_queue_ap_read(), stlink_dap_op_queue_ap_write(), and stlink_dap_run_internal().
|
static |
Definition at line 4120 of file stlink_usb.c.
References clear_bit(), DP_APSEL_MAX, ERROR_OK, stlink_usb_version::flags, stlink_usb_handle_s::reconnect_pending, stlink_usb_handle_s::st_mode, stlink_dap_handle, stlink_dap_open_ap(), STLINK_F_HAS_AP_INIT, stlink_usb_mode_enter(), stlink_usb_mode_leave(), test_bit(), and stlink_usb_handle_s::version.
Referenced by stlink_dap_check_reconnect().
|
static |
Definition at line 5122 of file stlink_usb.c.
References LOG_DEBUG, stlink_dap_handle, STLINK_DEBUG_APIV2_DRIVE_NRST_HIGH, STLINK_DEBUG_APIV2_DRIVE_NRST_LOW, and stlink_usb_assert_srst().
|
static |
Definition at line 4627 of file stlink_usb.c.
References CDBGPWRUPREQ, CSYSPWRUPREQ, dap_queue::dap, adiv5_dap::do_reconnect, DP_ABORT, DP_CTRL_STAT, adiv5_dap::dp_ctrl_stat, DP_RDBUFF, ERROR_OK, LOG_ERROR, NULL, SSTICKYERR, stlink_usb_handle_s::st_mode, STKERRCLR, stlink_dap_dp_read(), stlink_dap_dp_write(), stlink_dap_get_and_clear_error(), stlink_dap_handle, adiv5_dap::stlink_flush_ap_write, and STLINK_MODE_DEBUG_JTAG.
Referenced by stlink_dap_op_queue_run().
|
static |
Definition at line 4572 of file stlink_usb.c.
References ADIV5_MEM_AP_REG_CSW, dap_queue::ap_r, dap_queue::ap_w, dap_queue::cmd, CMD_AP_READ, CMD_AP_WRITE, CMD_DP_READ, CMD_DP_WRITE, CMD_MEM_AP_READ16, CMD_MEM_AP_READ32, CMD_MEM_AP_READ8, CMD_MEM_AP_WRITE16, CMD_MEM_AP_WRITE32, CMD_MEM_AP_WRITE8, CSW_ADDRINC_PACKED, dap_queue::dp_r, dap_queue::dp_w, ERROR_FAIL, ERROR_OK, LOG_ERROR, stlink_usb_handle_s::queue, stlink_usb_handle_s::queue_index, stlink_dap_ap_read(), stlink_dap_ap_write(), stlink_dap_check_reconnect(), stlink_dap_dp_read(), stlink_dap_dp_write(), stlink_dap_get_error(), stlink_dap_handle, stlink_dap_record_error(), and stlink_usb_mem_rw_queue().
Referenced by stlink_dap_op_queue_ap_read(), stlink_dap_op_queue_ap_write(), stlink_dap_op_queue_dp_read(), stlink_dap_op_queue_dp_write(), and stlink_dap_op_queue_run().
|
static |
Definition at line 5131 of file stlink_usb.c.
References ERROR_JTAG_NOT_IMPLEMENTED, ERROR_OK, hl_interface_param_s::initial_interface_speed, LOG_ERROR, stlink_dap_handle, stlink_dap_param, and stlink_speed().
|
static |
Definition at line 5156 of file stlink_usb.c.
|
static |
Definition at line 4943 of file stlink_usb.c.
References size, stlink_dap_handle, and stlink_usb_trace_read().
|
static |
Definition at line 3089 of file stlink_usb.c.
References LOG_DEBUG.
Referenced by stlink_usb_init_mode().
|
static |
Definition at line 3099 of file stlink_usb.c.
References stlink_usb_handle_s::cmdbuf, stlink_usb_handle_s::cmdidx, stlink_usb_handle_s::databuf, stlink_usb_version::jtag_api, le_to_h_u32(), LOG_ERROR, stlink_usb_handle_s::rx_ep, size, speed_map::speed, speed_map::speed_divisor, STLINK_APIV3_GET_COM_FREQ, STLINK_DEBUG_COMMAND, STLINK_JTAG_API_V3, stlink_usb_init_buffer(), stlink_usb_xfer_errcheck(), STLINK_V3_MAX_FREQ_NB, and stlink_usb_handle_s::version.
Referenced by stlink_speed_v3(), and stlink_usb_init_mode().
|
static |
Definition at line 1631 of file stlink_usb.c.
Referenced by stlink_usb_hl_open().
|
static |
Definition at line 3001 of file stlink_usb.c.
References LOG_INFO, and speed_map::speed.
Referenced by stlink_speed_jtag(), stlink_speed_swd(), and stlink_speed_v3().
|
static |
Definition at line 2797 of file stlink_usb.c.
Referenced by stlink_usb_read_ap_mem(), and stlink_usb_write_ap_mem().
|
static |
Definition at line 3689 of file stlink_usb.c.
References adapter_get_required_serial(), stlink_usb_handle_s::backend, buffer, CPUID, ERROR_FAIL, ERROR_OK, stlink_usb_version::jtag, stlink_usb_version::jtag_api, le_to_h_u32(), LOG_DEBUG, LOG_ERROR, stlink_usb_handle_s::max_mem_packet, mode, param, aice_port_param_s::pid, stlink_usb_handle_s::st_mode, stlink_close(), STLINK_HLA_AP_NUM, STLINK_HLA_CSW, STLINK_JTAG_API_V1, STLINK_MODE_DEBUG_JTAG, STLINK_MODE_DEBUG_SWD, STLINK_MODE_DEBUG_SWIM, STLINK_SWIM_DATA_SIZE, stlink_swim_enter(), stlink_tcp_backend, stlink_usb_backend, stlink_usb_init_mode(), stlink_usb_open(), stlink_usb_open_ap(), stlink_usb_read_mem32(), stlink_usb_version::swim, stlink_usb_handle_s::version, and aice_port_param_s::vid.
Referenced by stlink_dap_init(), and stlink_usb_hl_open().
|
static |
Definition at line 3952 of file stlink_usb.c.
References addr, stlink_usb_handle_s::cmdbuf, stlink_usb_handle_s::cmdidx, stlink_usb_handle_s::databuf, ERROR_COMMAND_NOTFOUND, stlink_usb_version::flags, h_u16_to_le(), le_to_h_u32(), LOG_DEBUG_IO, stlink_usb_handle_s::rx_ep, STLINK_DEBUG_APIV2_READ_DAP_REG, STLINK_DEBUG_COMMAND, STLINK_F_HAS_DAP_REG, stlink_usb_init_buffer(), stlink_usb_xfer_errcheck(), and stlink_usb_handle_s::version.
Referenced by stlink_dap_ap_read(), and stlink_dap_dp_read().
|
static |
Definition at line 3134 of file stlink_usb.c.
References stlink_usb_handle_s::cmdbuf, stlink_usb_handle_s::cmdidx, stlink_usb_handle_s::databuf, h_u32_to_le(), stlink_usb_version::jtag_api, LOG_ERROR, stlink_usb_handle_s::rx_ep, STLINK_APIV3_SET_COM_FREQ, STLINK_DEBUG_COMMAND, STLINK_JTAG_API_V3, stlink_usb_init_buffer(), stlink_usb_xfer_errcheck(), and stlink_usb_handle_s::version.
Referenced by stlink_speed_v3().
|
static |
Definition at line 3175 of file stlink_usb.c.
References stlink_usb_version::jtag_api, stlink_usb_handle_s::st_mode, STLINK_JTAG_API_V3, STLINK_MODE_DEBUG_JTAG, STLINK_MODE_DEBUG_SWD, STLINK_MODE_DEBUG_SWIM, stlink_speed_jtag(), stlink_speed_swd(), stlink_speed_swim(), stlink_speed_v3(), and stlink_usb_handle_s::version.
Referenced by stlink_dap_khz(), stlink_dap_speed(), and stlink_usb_init_mode().
|
static |
Definition at line 3066 of file stlink_usb.c.
References ARRAY_SIZE, ERROR_OK, stlink_usb_version::flags, LOG_ERROR, speed_map::speed, STLINK_F_HAS_JTAG_SET_FREQ, stlink_khz_to_speed_map_jtag, stlink_match_speed_map(), stlink_usb_set_jtagclk(), and stlink_usb_handle_s::version.
Referenced by stlink_speed().
|
static |
Definition at line 3043 of file stlink_usb.c.
References ARRAY_SIZE, ERROR_OK, stlink_usb_version::flags, LOG_ERROR, speed_map::speed, STLINK_F_HAS_SWD_SET_FREQ, stlink_khz_to_speed_map_swd, stlink_match_speed_map(), stlink_usb_set_swdclk(), and stlink_usb_handle_s::version.
Referenced by stlink_speed().
|
static |
Definition at line 2983 of file stlink_usb.c.
References ERROR_OK, LOG_ERROR, stlink_swim_speed(), SWIM_FREQ_HIGH, and SWIM_FREQ_LOW.
Referenced by stlink_speed().
|
static |
Definition at line 3155 of file stlink_usb.c.
References ARRAY_SIZE, ERROR_OK, LOG_ERROR, speed_map::speed, stlink_get_com_freq(), stlink_match_speed_map(), stlink_set_com_freq(), and STLINK_V3_MAX_FREQ_NB.
Referenced by stlink_speed().
|
static |
Definition at line 1830 of file stlink_usb.c.
References stlink_usb_handle_s::cmdbuf, stlink_usb_handle_s::cmdidx, stlink_usb_handle_s::databuf, ERROR_OK, stlink_usb_handle_s::rx_ep, stlink_cmd_allow_retry(), STLINK_SWIM_ASSERT_RESET, STLINK_SWIM_COMMAND, STLINK_SWIM_DEASSERT_RESET, and stlink_usb_init_buffer().
Referenced by stlink_usb_assert_srst().
|
static |
Definition at line 1851 of file stlink_usb.c.
References stlink_usb_handle_s::cmdbuf, stlink_usb_handle_s::cmdidx, stlink_usb_handle_s::databuf, ERROR_OK, stlink_usb_handle_s::rx_ep, stlink_cmd_allow_retry(), STLINK_SWIM_COMMAND, STLINK_SWIM_ENTER_SEQ, and stlink_usb_init_buffer().
Referenced by stlink_open().
|
static |
Definition at line 1888 of file stlink_usb.c.
References stlink_usb_handle_s::cmdbuf, stlink_usb_handle_s::cmdidx, stlink_usb_handle_s::databuf, ERROR_OK, stlink_usb_handle_s::rx_ep, stlink_cmd_allow_retry(), STLINK_SWIM_COMMAND, STLINK_SWIM_GEN_RST, and stlink_usb_init_buffer().
Referenced by stlink_swim_op_srst().
|
static |
Definition at line 4876 of file stlink_usb.c.
References addr, buffer, count, ERROR_OK, LOG_DEBUG_IO, size, stlink_dap_handle, STLINK_SWIM_DATA_SIZE, and stlink_swim_readbytes().
|
static |
Definition at line 4922 of file stlink_usb.c.
References ERROR_OK, stlink_dap_handle, STLINK_MODE_DEBUG_SWIM, stlink_swim_resync(), and stlink_usb_mode_enter().
|
static |
Definition at line 4871 of file stlink_usb.c.
References stlink_dap_handle, and stlink_swim_generate_rst().
|
static |
Definition at line 4899 of file stlink_usb.c.
References addr, buffer, count, ERROR_OK, LOG_DEBUG_IO, size, stlink_dap_handle, STLINK_SWIM_DATA_SIZE, and stlink_swim_writebytes().
|
static |
Definition at line 1957 of file stlink_usb.c.
References addr, stlink_usb_handle_s::cmdbuf, stlink_usb_handle_s::cmdidx, stlink_usb_handle_s::databuf, ERROR_FAIL, ERROR_OK, h_u16_to_be(), h_u32_to_be(), stlink_usb_handle_s::rx_ep, stlink_cmd_allow_retry(), STLINK_SWIM_COMMAND, STLINK_SWIM_DATA_SIZE, STLINK_SWIM_READBUF, STLINK_SWIM_READMEM, stlink_usb_init_buffer(), and stlink_usb_xfer_noerrcheck().
Referenced by stlink_swim_op_read_mem().
|
static |
Definition at line 1907 of file stlink_usb.c.
References stlink_usb_handle_s::cmdbuf, stlink_usb_handle_s::cmdidx, stlink_usb_handle_s::databuf, ERROR_OK, stlink_usb_handle_s::rx_ep, stlink_cmd_allow_retry(), STLINK_SWIM_COMMAND, STLINK_SWIM_RESET, and stlink_usb_init_buffer().
Referenced by stlink_swim_op_reconnect().
|
static |
Definition at line 1866 of file stlink_usb.c.
References stlink_usb_handle_s::cmdbuf, stlink_usb_handle_s::cmdidx, stlink_usb_handle_s::databuf, ERROR_OK, stlink_usb_handle_s::rx_ep, stlink_cmd_allow_retry(), STLINK_SWIM_COMMAND, STLINK_SWIM_SPEED, and stlink_usb_init_buffer().
Referenced by stlink_speed_swim().
|
static |
Definition at line 1793 of file stlink_usb.c.
References stlink_usb_handle_s::cmdbuf, stlink_usb_handle_s::cmdidx, stlink_usb_handle_s::databuf, ERROR_OK, stlink_usb_handle_s::rx_ep, STLINK_SWIM_COMMAND, STLINK_SWIM_READSTATUS, stlink_usb_init_buffer(), and stlink_usb_xfer_noerrcheck().
Referenced by stlink_cmd_allow_retry().
|
static |
Definition at line 1921 of file stlink_usb.c.
References addr, stlink_usb_handle_s::cmdbuf, stlink_usb_handle_s::cmdidx, stlink_usb_handle_s::databuf, ERROR_FAIL, ERROR_OK, h_u16_to_be(), h_u32_to_be(), stlink_usb_version::stlink, stlink_cmd_allow_retry(), STLINK_CMD_SIZE_V2, STLINK_SG_SIZE, STLINK_SWIM_COMMAND, STLINK_SWIM_DATA_SIZE, STLINK_SWIM_WRITEMEM, stlink_usb_init_buffer(), stlink_usb_set_cbw_transfer_datalength(), stlink_usb_handle_s::tx_ep, and stlink_usb_handle_s::version.
Referenced by stlink_swim_op_write_mem().
|
static |
Definition at line 3226 of file stlink_usb.c.
References close_socket(), stlink_tcp_priv_s::connect_id, stlink_tcp_priv_s::connected, ERROR_OK, stlink_tcp_priv_s::fd, h_u32_to_le(), LOG_ERROR, stlink_tcp_priv_s::recv_buf, stlink_tcp_priv_s::send_buf, STLINK_TCP_CMD_CLOSE_DEV, stlink_tcp_send_cmd(), stlink_usb_exit_mode(), and stlink_usb_handle_s::tcp_backend_priv.
|
static |
Definition at line 3460 of file stlink_usb.c.
|
static |
Definition at line 1039 of file stlink_usb.c.
References size, stlink_tcp_xfer_noerrcheck(), stlink_usb_init_buffer(), and stlink_usb_handle_s::trace_ep.
|
static |
Definition at line 914 of file stlink_usb.c.
References ERROR_FAIL, ERROR_OK, ERROR_TIMEOUT_REACHED, ERROR_WAIT, stlink_tcp_priv_s::fd, keep_alive(), le_to_h_u32(), LOG_DEBUG, LOG_ERROR, stlink_tcp_priv_s::recv_buf, stlink_tcp_priv_s::send_buf, STLINK_TCP_SS_OK, STLINK_TCP_SS_TCP_BUSY, stlink_usb_handle_s::tcp_backend_priv, and timeval_ms().
Referenced by stlink_tcp_close(), and stlink_tcp_xfer_noerrcheck().
|
static |
Definition at line 979 of file stlink_usb.c.
References stlink_tcp_priv_s::connect_id, stlink_usb_handle_s::direction, ERROR_FAIL, ERROR_OK, h_u32_to_le(), LOG_ERROR, stlink_tcp_priv_s::recv_buf, stlink_tcp_priv_s::send_buf, size, STLINK_TCP_CMD_SEND_USB_CMD, STLINK_TCP_RECV_BUFFER_SIZE, STLINK_TCP_SEND_BUFFER_SIZE, stlink_tcp_send_cmd(), STLINK_TCP_SS_SIZE, STLINK_TCP_USB_CMD_SIZE, stlink_usb_handle_s::tcp_backend_priv, and stlink_usb_handle_s::tx_ep.
Referenced by stlink_tcp_read_trace().
|
static |
Definition at line 2162 of file stlink_usb.c.
References stlink_usb_handle_s::cmdbuf, stlink_usb_handle_s::cmdidx, stlink_usb_handle_s::databuf, ERROR_COMMAND_NOTFOUND, stlink_usb_handle_s::rx_ep, stlink_usb_handle_s::st_mode, stlink_usb_version::stlink, stlink_cmd_allow_retry(), STLINK_DEBUG_APIV2_DRIVE_NRST, STLINK_DEBUG_COMMAND, STLINK_MODE_DEBUG_SWIM, stlink_swim_assert_reset(), stlink_usb_init_buffer(), and stlink_usb_handle_s::version.
Referenced by stlink_dap_reset(), and stlink_usb_init_mode().
|
static |
Definition at line 566 of file stlink_usb.c.
References stlink_usb_version::flags, STLINK_F_HAS_RW8_512BYTES, STLINK_MAX_RW8, STLINKV3_MAX_RW8, and stlink_usb_handle_s::version.
Referenced by stlink_usb_count_buf_rw_queue(), stlink_usb_read_ap_mem(), stlink_usb_read_mem8(), stlink_usb_write_ap_mem(), and stlink_usb_write_mem8().
|
static |
Definition at line 4420 of file stlink_usb.c.
References addr, cmd, CMD_MEM_AP_2_SIZE, CMD_MEM_AP_READ16, CMD_MEM_AP_READ32, CMD_MEM_AP_READ8, CMD_MEM_AP_WRITE16, CMD_MEM_AP_WRITE32, CMD_MEM_AP_WRITE8, count, ERROR_FAIL, ERROR_OK, h_u16_to_le(), h_u32_to_le(), le_to_h_u16(), le_to_h_u32(), dap_queue::mem_ap, stlink_dap_handle, stlink_dap_open_ap(), stlink_usb_read_mem16(), stlink_usb_read_mem32(), stlink_usb_read_mem32_noaddrinc(), stlink_usb_read_mem8(), stlink_usb_write_mem16(), stlink_usb_write_mem32(), stlink_usb_write_mem32_noaddrinc(), and stlink_usb_write_mem8().
Referenced by stlink_usb_mem_rw_queue().
|
static |
Definition at line 1443 of file stlink_usb.c.
References stlink_usb_handle_s::cmdbuf, stlink_usb_handle_s::cmdidx, stlink_usb_handle_s::databuf, ERROR_COMMAND_NOTFOUND, ERROR_OK, stlink_usb_version::flags, le_to_h_u32(), LOG_INFO, stlink_usb_handle_s::rx_ep, STLINK_F_HAS_TARGET_VOLT, STLINK_GET_TARGET_VOLTAGE, stlink_usb_init_buffer(), stlink_usb_xfer_noerrcheck(), and stlink_usb_handle_s::version.
Referenced by stlink_usb_init_mode().
|
inlinestatic |
Definition at line 302 of file stlink_usb.c.
References stlink_usb_handle_s::backend, and stlink_backend_s::close.
Referenced by stlink_close().
|
static |
Definition at line 3881 of file stlink_usb.c.
References stlink_usb_handle_s::cmdbuf, stlink_usb_handle_s::cmdidx, stlink_usb_handle_s::databuf, ERROR_COMMAND_NOTFOUND, stlink_usb_version::flags, LOG_DEBUG_IO, stlink_usb_handle_s::rx_ep, STLINK_DEBUG_APIV2_CLOSE_AP_DBG, STLINK_DEBUG_COMMAND, STLINK_F_FIX_CLOSE_AP, STLINK_F_HAS_AP_INIT, stlink_usb_init_buffer(), stlink_usb_xfer_errcheck(), stlink_usb_xfer_noerrcheck(), and stlink_usb_handle_s::version.
Referenced by stlink_dap_closeall_ap().
|
static |
Definition at line 4523 of file stlink_usb.c.
References mem_ap::ap, cmd, CMD_MEM_AP_2_SIZE, dap_queue::mem_ap, stlink_dap_handle, STLINK_MAX_RW16_32, and stlink_usb_block().
Referenced by stlink_usb_mem_rw_queue().
|
static |
Definition at line 4484 of file stlink_usb.c.
References mem_ap::ap, adiv5_ap::ap_num, stlink_tcp_version::api, stlink_usb_handle_s::backend, cmd, CMD_MEM_AP_READ32, CMD_MEM_AP_WRITE32, count, DP_APSEL_INVALID, stlink_usb_version::flags, dap_queue::mem_ap, stlink_usb_version::stlink, STLINK_F_HAS_RW_MISC, stlink_tcp_backend, STLINK_V2_RW_MISC_SIZE, STLINK_V3_RW_MISC_SIZE, stlink_usb_handle_s::tcp_backend_priv, stlink_tcp_priv_s::version, and stlink_usb_handle_s::version.
Referenced by stlink_usb_mem_rw_queue().
|
static |
Definition at line 1524 of file stlink_usb.c.
References stlink_usb_handle_s::cmdbuf, stlink_usb_handle_s::cmdidx, stlink_usb_handle_s::databuf, ERROR_OK, mode, stlink_usb_handle_s::rx_ep, STLINK_GET_CURRENT_MODE, stlink_usb_init_buffer(), and stlink_usb_xfer_noerrcheck().
Referenced by stlink_usb_exit_mode(), and stlink_usb_init_mode().
|
static |
Converts an STLINK status code held in the first byte of a response to an openocd error, logs any error/wait status as debug output.
Definition at line 1051 of file stlink_usb.c.
References stlink_usb_handle_s::databuf, ERROR_FAIL, ERROR_OK, ERROR_WAIT, stlink_usb_version::jtag_api, LOG_DEBUG, stlink_usb_handle_s::st_mode, STLINK_BAD_AP_ERROR, STLINK_DEBUG_ERR_FAULT, STLINK_DEBUG_ERR_OK, STLINK_JTAG_API_V1, STLINK_JTAG_GET_IDCODE_ERROR, STLINK_JTAG_WRITE_ERROR, STLINK_JTAG_WRITE_VERIF_ERROR, STLINK_MODE_DEBUG_SWIM, STLINK_SWD_AP_ERROR, STLINK_SWD_AP_FAULT, STLINK_SWD_AP_PARITY_ERROR, STLINK_SWD_AP_STICKY_ERROR, STLINK_SWD_AP_STICKYORUN_ERROR, STLINK_SWD_AP_WAIT, STLINK_SWD_AP_WDATA_ERROR, STLINK_SWD_DP_ERROR, STLINK_SWD_DP_FAULT, STLINK_SWD_DP_PARITY_ERROR, STLINK_SWD_DP_WAIT, STLINK_SWIM_BUSY, STLINK_SWIM_ERR_OK, and stlink_usb_handle_s::version.
Referenced by stlink_cmd_allow_retry(), and stlink_usb_xfer_errcheck().
|
static |
Definition at line 1646 of file stlink_usb.c.
References ERROR_OK, LOG_DEBUG, mode, STLINK_DEV_BOOTLOADER_MODE, STLINK_DEV_DEBUG_MODE, STLINK_DEV_DFU_MODE, STLINK_DEV_MASS_MODE, STLINK_DEV_SWIM_MODE, STLINK_MODE_DEBUG_SWD, STLINK_MODE_DEBUG_SWIM, STLINK_MODE_DFU, STLINK_MODE_UNKNOWN, stlink_usb_current_mode(), and stlink_usb_mode_leave().
Referenced by stlink_tcp_close(), stlink_usb_init_mode(), and stlink_usb_usb_close().
|
static |
Definition at line 3287 of file stlink_usb.c.
References device, LOG_ERROR, NULL, and STLINK_SERIAL_LEN.
Referenced by stlink_usb_usb_open().
|
static |
Definition at line 2429 of file stlink_usb.c.
References stlink_usb_handle_s::cmdbuf, stlink_usb_handle_s::cmdidx, stlink_usb_handle_s::databuf, ERROR_OK, stlink_usb_version::flags, stlink_usb_version::jtag_api, stlink_usb_handle_s::rx_ep, STLINK_DEBUG_APIV2_GETLASTRWSTATUS, STLINK_DEBUG_APIV2_GETLASTRWSTATUS2, STLINK_DEBUG_COMMAND, STLINK_F_HAS_GETLASTRWSTATUS2, STLINK_JTAG_API_V1, stlink_usb_init_buffer(), stlink_usb_xfer_errcheck(), and stlink_usb_handle_s::version.
Referenced by stlink_usb_read_mem16(), stlink_usb_read_mem32(), stlink_usb_read_mem32_noaddrinc(), stlink_usb_read_mem8(), stlink_usb_write_mem16(), stlink_usb_write_mem32(), stlink_usb_write_mem32_noaddrinc(), and stlink_usb_write_mem8().
|
static |
Definition at line 2289 of file stlink_usb.c.
References C_DEBUGEN, C_HALT, stlink_usb_handle_s::cmdbuf, stlink_usb_handle_s::cmdidx, stlink_usb_handle_s::databuf, DBGKEY, DCB_DHCSR, stlink_usb_version::jtag_api, stlink_usb_handle_s::rx_ep, stlink_cmd_allow_retry(), STLINK_DEBUG_COMMAND, STLINK_DEBUG_FORCEDEBUG, STLINK_JTAG_API_V1, stlink_usb_init_buffer(), stlink_usb_write_debug_reg(), and stlink_usb_handle_s::version.
|
static |
Definition at line 3793 of file stlink_usb.c.
References param, stlink_get_mode(), and stlink_open().
|
static |
Definition at line 1987 of file stlink_usb.c.
References stlink_usb_handle_s::cmdbuf, stlink_usb_handle_s::cmdidx, stlink_usb_handle_s::databuf, ERROR_OK, stlink_usb_version::jtag_api, le_to_h_u32(), LOG_DEBUG, offset, stlink_usb_handle_s::rx_ep, stlink_usb_handle_s::st_mode, STLINK_DEBUG_APIV2_READ_IDCODES, STLINK_DEBUG_COMMAND, STLINK_DEBUG_READCOREID, STLINK_JTAG_API_V1, STLINK_MODE_DEBUG_SWIM, stlink_usb_init_buffer(), stlink_usb_xfer_errcheck(), stlink_usb_xfer_noerrcheck(), and stlink_usb_handle_s::version.
Referenced by stlink_dap_op_connect().
|
static |
Definition at line 3862 of file stlink_usb.c.
References stlink_usb_handle_s::cmdbuf, stlink_usb_handle_s::cmdidx, stlink_usb_handle_s::databuf, ERROR_COMMAND_NOTFOUND, stlink_usb_version::flags, LOG_DEBUG_IO, stlink_usb_handle_s::rx_ep, STLINK_DEBUG_APIV2_INIT_AP, STLINK_DEBUG_COMMAND, STLINK_F_HAS_AP_INIT, stlink_usb_init_buffer(), stlink_usb_xfer_errcheck(), and stlink_usb_handle_s::version.
Referenced by stlink_usb_open_ap().
|
static |
Definition at line 1233 of file stlink_usb.c.
References stlink_usb_handle_s::cmdbuf, stlink_usb_handle_s::cmdidx, stlink_usb_handle_s::databuf, direction, stlink_usb_handle_s::direction, size, stlink_usb_version::stlink, STLINK_DATA_SIZE, STLINK_SG_SIZE, stlink_usb_xfer_v1_create_cmd(), and stlink_usb_handle_s::version.
Referenced by __attribute__(), COMMAND_HANDLER(), stlink_get_com_freq(), stlink_read_dap_register(), stlink_set_com_freq(), stlink_swim_assert_reset(), stlink_swim_enter(), stlink_swim_generate_rst(), stlink_swim_readbytes(), stlink_swim_resync(), stlink_swim_speed(), stlink_swim_status(), stlink_swim_writebytes(), stlink_tcp_read_trace(), stlink_usb_assert_srst(), stlink_usb_check_voltage(), stlink_usb_close_access_port(), stlink_usb_current_mode(), stlink_usb_get_rw_status(), stlink_usb_halt(), stlink_usb_idcode(), stlink_usb_init_access_port(), stlink_usb_mode_enter(), stlink_usb_mode_leave(), stlink_usb_read_mem16(), stlink_usb_read_mem32(), stlink_usb_read_mem32_noaddrinc(), stlink_usb_read_mem8(), stlink_usb_read_reg(), stlink_usb_read_regs(), stlink_usb_reset(), stlink_usb_run(), stlink_usb_rw_misc_in(), stlink_usb_rw_misc_out(), stlink_usb_set_jtagclk(), stlink_usb_set_swdclk(), stlink_usb_state(), stlink_usb_step(), stlink_usb_trace_disable(), stlink_usb_trace_enable(), stlink_usb_v2_read_debug_reg(), stlink_usb_version(), stlink_usb_write_debug_reg(), stlink_usb_write_mem16(), stlink_usb_write_mem32(), stlink_usb_write_mem32_noaddrinc(), stlink_usb_write_mem8(), stlink_usb_write_reg(), and stlink_usb_xfer_v1_get_sense().
|
static |
Definition at line 1686 of file stlink_usb.c.
References ARRAY_SIZE, ERROR_COMMAND_NOTFOUND, ERROR_FAIL, ERROR_OK, stlink_usb_version::flags, stlink_usb_version::jtag_api, LOG_DEBUG, LOG_ERROR, mode, stlink_usb_handle_s::st_mode, STLINK_DEV_DFU_MODE, stlink_dump_speed_map(), STLINK_F_HAS_JTAG_SET_FREQ, STLINK_F_HAS_SWD_SET_FREQ, stlink_get_com_freq(), STLINK_JTAG_API_V3, stlink_khz_to_speed_map_jtag, stlink_khz_to_speed_map_swd, STLINK_MODE_DEBUG_JTAG, STLINK_MODE_DEBUG_SWD, STLINK_MODE_DEBUG_SWIM, STLINK_MODE_UNKNOWN, stlink_speed(), stlink_usb_assert_srst(), stlink_usb_check_voltage(), stlink_usb_current_mode(), stlink_usb_exit_mode(), stlink_usb_mode_enter(), STLINK_V3_MAX_FREQ_NB, and stlink_usb_handle_s::version.
Referenced by stlink_open().
|
static |
Definition at line 4550 of file stlink_usb.c.
References count, ERROR_OK, stlink_usb_buf_rw_segment(), stlink_usb_count_buf_rw_queue(), stlink_usb_count_misc_rw_queue(), and stlink_usb_misc_rw_segment().
Referenced by stlink_dap_run_internal().
|
static |
Definition at line 4334 of file stlink_usb.c.
References ALIGN_UP, mem_ap::ap, adiv5_ap::ap_num, cmd, cmd_index, CMD_MEM_AP_READ32, CMD_MEM_AP_WRITE32, DP_APSEL_INVALID, ERROR_FAIL, ERROR_OK, h_u32_to_le(), IS_ALIGNED, le_to_h_u32(), LOG_DEBUG, LOG_ERROR, dap_queue::mem_ap, RW_MISC_CMD_ADDRESS, RW_MISC_CMD_APNUM, RW_MISC_CMD_READ, RW_MISC_CMD_WRITE, STLINK_DEBUG_ERR_OK, stlink_usb_rw_misc_in(), and stlink_usb_rw_misc_out().
Referenced by stlink_usb_mem_rw_queue().
|
static |
Definition at line 1546 of file stlink_usb.c.
References stlink_usb_handle_s::cmdbuf, stlink_usb_handle_s::cmdidx, stlink_usb_handle_s::databuf, ERROR_FAIL, stlink_usb_version::jtag_api, stlink_usb_handle_s::rx_ep, stlink_cmd_allow_retry(), STLINK_DEBUG_APIV1_ENTER, STLINK_DEBUG_APIV2_ENTER, STLINK_DEBUG_COMMAND, STLINK_DEBUG_ENTER_JTAG_NO_RESET, STLINK_DEBUG_ENTER_SWD_NO_RESET, STLINK_JTAG_API_V1, STLINK_MODE_DEBUG_JTAG, STLINK_MODE_DEBUG_SWD, STLINK_MODE_DEBUG_SWIM, STLINK_MODE_DFU, STLINK_MODE_MASS, STLINK_SWIM_COMMAND, STLINK_SWIM_ENTER, stlink_usb_init_buffer(), stlink_usb_xfer_noerrcheck(), type, and stlink_usb_handle_s::version.
Referenced by stlink_dap_reinit_interface(), stlink_swim_op_reconnect(), and stlink_usb_init_mode().
|
static |
Definition at line 1594 of file stlink_usb.c.
References stlink_usb_handle_s::cmdbuf, stlink_usb_handle_s::cmdidx, stlink_usb_handle_s::databuf, ERROR_FAIL, ERROR_OK, stlink_usb_handle_s::rx_ep, STLINK_DEBUG_COMMAND, STLINK_DEBUG_EXIT, STLINK_DFU_COMMAND, STLINK_DFU_EXIT, STLINK_MODE_DEBUG_JTAG, STLINK_MODE_DEBUG_SWD, STLINK_MODE_DEBUG_SWIM, STLINK_MODE_DFU, STLINK_MODE_MASS, STLINK_SWIM_COMMAND, STLINK_SWIM_EXIT, stlink_usb_init_buffer(), stlink_usb_xfer_noerrcheck(), and type.
Referenced by stlink_dap_reinit_interface(), and stlink_usb_exit_mode().
|
inlinestatic |
Definition at line 295 of file stlink_usb.c.
References stlink_usb_handle_s::backend, stlink_backend_s::open, and param.
Referenced by stlink_open().
|
static |
Definition at line 4069 of file stlink_usb.c.
References DP_APSEL_MAX, ERROR_FAIL, ERROR_OK, stlink_usb_version::flags, last_csw_default, LOG_DEBUG, set_bit(), STLINK_F_HAS_AP_INIT, stlink_usb_init_access_port(), test_bit(), and stlink_usb_handle_s::version.
Referenced by stlink_dap_open_ap(), and stlink_open().
|
static |
Definition at line 2978 of file stlink_usb.c.
|
static |
Definition at line 2805 of file stlink_usb.c.
References addr, buffer, count, ERROR_OK, ERROR_WAIT, stlink_usb_version::flags, stlink_usb_handle_s::max_mem_packet, MAX_WAIT_RETRIES, size, STLINK_F_HAS_MEM_16BIT, stlink_max_block_size(), stlink_usb_block(), stlink_usb_read_mem16(), stlink_usb_read_mem32(), stlink_usb_read_mem8(), and stlink_usb_handle_s::version.
Referenced by stlink_usb_read_mem().
|
static |
Definition at line 2883 of file stlink_usb.c.
References addr, buffer, count, size, STLINK_HLA_AP_NUM, STLINK_HLA_CSW, and stlink_usb_read_ap_mem().
|
static |
Definition at line 2534 of file stlink_usb.c.
References addr, buffer, stlink_usb_handle_s::cmdbuf, stlink_usb_handle_s::cmdidx, stlink_usb_handle_s::databuf, ERROR_COMMAND_NOTFOUND, ERROR_FAIL, ERROR_OK, ERROR_TARGET_UNALIGNED_ACCESS, stlink_usb_version::flags, h_u16_to_le(), h_u24_to_le(), h_u32_to_le(), LOG_DEBUG, stlink_usb_handle_s::rx_ep, STLINK_DEBUG_APIV2_READMEM_16BIT, STLINK_DEBUG_COMMAND, STLINK_F_HAS_CSW, STLINK_F_HAS_MEM_16BIT, STLINK_MAX_RW16_32, stlink_usb_get_rw_status(), stlink_usb_init_buffer(), stlink_usb_xfer_noerrcheck(), and stlink_usb_handle_s::version.
Referenced by stlink_usb_buf_rw_segment(), and stlink_usb_read_ap_mem().
|
static |
Definition at line 2628 of file stlink_usb.c.
References addr, buffer, stlink_usb_handle_s::cmdbuf, stlink_usb_handle_s::cmdidx, stlink_usb_handle_s::databuf, ERROR_COMMAND_NOTFOUND, ERROR_FAIL, ERROR_OK, ERROR_TARGET_UNALIGNED_ACCESS, stlink_usb_version::flags, h_u16_to_le(), h_u24_to_le(), h_u32_to_le(), LOG_DEBUG, stlink_usb_handle_s::rx_ep, STLINK_DEBUG_COMMAND, STLINK_DEBUG_READMEM_32BIT, STLINK_F_HAS_CSW, STLINK_MAX_RW16_32, stlink_usb_get_rw_status(), stlink_usb_init_buffer(), stlink_usb_xfer_noerrcheck(), and stlink_usb_handle_s::version.
Referenced by stlink_open(), stlink_usb_buf_rw_segment(), and stlink_usb_read_ap_mem().
|
static |
Definition at line 2715 of file stlink_usb.c.
References addr, buffer, stlink_usb_handle_s::cmdbuf, stlink_usb_handle_s::cmdidx, stlink_usb_handle_s::databuf, ERROR_COMMAND_NOTFOUND, ERROR_FAIL, ERROR_OK, ERROR_TARGET_UNALIGNED_ACCESS, stlink_usb_version::flags, h_u16_to_le(), h_u24_to_le(), h_u32_to_le(), LOG_DEBUG, NULL, stlink_usb_handle_s::rx_ep, STLINK_DEBUG_COMMAND, STLINK_DEBUG_READMEM_32BIT_NO_ADDR_INC, STLINK_F_HAS_MEM_RD_NO_INC, STLINK_MAX_RW16_32, stlink_usb_get_rw_status(), stlink_usb_init_buffer(), stlink_usb_xfer_noerrcheck(), and stlink_usb_handle_s::version.
Referenced by stlink_usb_buf_rw_segment().
|
static |
Definition at line 2451 of file stlink_usb.c.
References addr, buffer, stlink_usb_handle_s::cmdbuf, stlink_usb_handle_s::cmdidx, stlink_usb_handle_s::databuf, ERROR_COMMAND_NOTFOUND, ERROR_FAIL, ERROR_OK, stlink_usb_version::flags, h_u16_to_le(), h_u24_to_le(), h_u32_to_le(), LOG_DEBUG, stlink_usb_handle_s::rx_ep, STLINK_DEBUG_COMMAND, STLINK_DEBUG_READMEM_8BIT, STLINK_F_HAS_CSW, stlink_usb_block(), stlink_usb_get_rw_status(), stlink_usb_init_buffer(), stlink_usb_xfer_noerrcheck(), and stlink_usb_handle_s::version.
Referenced by stlink_usb_buf_rw_segment(), and stlink_usb_read_ap_mem().
|
static |
Definition at line 2359 of file stlink_usb.c.
References stlink_usb_handle_s::cmdbuf, stlink_usb_handle_s::cmdidx, stlink_usb_handle_s::databuf, DCB_DCRDR, DCB_DCRSR, ERROR_OK, stlink_usb_version::flags, stlink_usb_version::jtag_api, le_to_h_u32(), stlink_usb_handle_s::rx_ep, stlink_cmd_allow_retry(), STLINK_DEBUG_APIV1_READREG, STLINK_DEBUG_APIV2_READREG, STLINK_DEBUG_COMMAND, STLINK_F_HAS_FPU_REG, STLINK_JTAG_API_V1, STLINK_REGSEL_IS_FPU, stlink_usb_init_buffer(), stlink_usb_v2_read_debug_reg(), stlink_usb_write_debug_reg(), stlink_usb_xfer_noerrcheck(), and stlink_usb_handle_s::version.
|
static |
Definition at line 2334 of file stlink_usb.c.
References stlink_usb_handle_s::cmdbuf, stlink_usb_handle_s::cmdidx, stlink_usb_handle_s::databuf, stlink_usb_version::jtag_api, stlink_usb_handle_s::rx_ep, STLINK_DEBUG_APIV1_READALLREGS, STLINK_DEBUG_APIV2_READALLREGS, STLINK_DEBUG_COMMAND, STLINK_JTAG_API_V1, stlink_usb_init_buffer(), stlink_usb_xfer_errcheck(), stlink_usb_xfer_noerrcheck(), and stlink_usb_handle_s::version.
|
static |
Definition at line 1190 of file stlink_usb.c.
References stlink_usb_handle_s::backend, stlink_usb_version::flags, stlink_backend_s::read_trace, size, STLINK_F_HAS_TRACE, and stlink_usb_handle_s::version.
Referenced by stlink_usb_state().
|
static |
Definition at line 2238 of file stlink_usb.c.
References stlink_usb_handle_s::cmdbuf, stlink_usb_handle_s::cmdidx, stlink_usb_handle_s::databuf, stlink_usb_handle_s::enabled, ERROR_OK, stlink_usb_version::jtag_api, stlink_usb_handle_s::rx_ep, stlink_cmd_allow_retry(), STLINK_DEBUG_APIV1_RESETSYS, STLINK_DEBUG_APIV2_RESETSYS, STLINK_DEBUG_COMMAND, STLINK_JTAG_API_V1, stlink_usb_init_buffer(), stlink_usb_trace_disable(), stlink_usb_trace_enable(), stlink_usb_handle_s::trace, and stlink_usb_handle_s::version.
|
static |
Definition at line 2267 of file stlink_usb.c.
References C_DEBUGEN, stlink_usb_handle_s::cmdbuf, stlink_usb_handle_s::cmdidx, stlink_usb_handle_s::databuf, DBGKEY, DCB_DHCSR, stlink_usb_version::jtag_api, stlink_usb_handle_s::rx_ep, stlink_cmd_allow_retry(), STLINK_DEBUG_COMMAND, STLINK_DEBUG_RUNCORE, STLINK_JTAG_API_V1, stlink_usb_init_buffer(), stlink_usb_write_debug_reg(), and stlink_usb_handle_s::version.
|
static |
Definition at line 3925 of file stlink_usb.c.
References buffer, stlink_usb_handle_s::cmdbuf, stlink_usb_handle_s::cmdidx, stlink_usb_handle_s::databuf, ERROR_COMMAND_NOTFOUND, ERROR_OK, stlink_usb_version::flags, LOG_DEBUG_IO, NULL, stlink_usb_handle_s::rx_ep, STLINK_DEBUG_APIV2_RW_MISC_IN, STLINK_DEBUG_COMMAND, STLINK_F_HAS_RW_MISC, stlink_usb_init_buffer(), stlink_usb_xfer_noerrcheck(), and stlink_usb_handle_s::version.
Referenced by stlink_usb_misc_rw_segment().
|
static |
Definition at line 3904 of file stlink_usb.c.
References ALIGN_UP, buffer, stlink_usb_handle_s::cmdbuf, stlink_usb_handle_s::cmdidx, ERROR_COMMAND_NOTFOUND, stlink_usb_version::flags, h_u32_to_le(), LOG_DEBUG_IO, NULL, STLINK_DEBUG_APIV2_RW_MISC_OUT, STLINK_DEBUG_COMMAND, STLINK_F_HAS_RW_MISC, stlink_usb_init_buffer(), stlink_usb_xfer_noerrcheck(), stlink_usb_handle_s::tx_ep, and stlink_usb_handle_s::version.
Referenced by stlink_usb_misc_rw_segment().
|
static |
Definition at line 1205 of file stlink_usb.c.
References buf_set_u32(), stlink_usb_handle_s::cmdbuf, and size.
Referenced by stlink_swim_writebytes().
|
static |
Definition at line 1499 of file stlink_usb.c.
References stlink_usb_handle_s::cmdbuf, stlink_usb_handle_s::cmdidx, stlink_usb_handle_s::databuf, ERROR_COMMAND_NOTFOUND, ERROR_OK, stlink_usb_version::flags, h_u16_to_le(), stlink_usb_handle_s::rx_ep, stlink_cmd_allow_retry(), STLINK_DEBUG_APIV2_JTAG_SET_FREQ, STLINK_DEBUG_COMMAND, STLINK_F_HAS_JTAG_SET_FREQ, stlink_usb_init_buffer(), and stlink_usb_handle_s::version.
Referenced by stlink_speed_jtag().
|
static |
Definition at line 1475 of file stlink_usb.c.
References stlink_usb_handle_s::cmdbuf, stlink_usb_handle_s::cmdidx, stlink_usb_handle_s::databuf, ERROR_COMMAND_NOTFOUND, ERROR_OK, stlink_usb_version::flags, h_u16_to_le(), stlink_usb_handle_s::rx_ep, stlink_cmd_allow_retry(), STLINK_DEBUG_APIV2_SWD_SET_FREQ, STLINK_DEBUG_COMMAND, STLINK_F_HAS_SWD_SET_FREQ, stlink_usb_init_buffer(), and stlink_usb_handle_s::version.
Referenced by stlink_speed_swd().
|
static |
Definition at line 2069 of file stlink_usb.c.
References stlink_usb_handle_s::cmdbuf, stlink_usb_handle_s::cmdidx, stlink_usb_handle_s::databuf, stlink_usb_handle_s::enabled, ERROR_OK, stlink_usb_version::flags, le_to_h_u16(), stlink_usb_handle_s::rx_ep, size, STLINK_DEBUG_APIV2_GET_TRACE_NB, STLINK_DEBUG_COMMAND, STLINK_F_HAS_TRACE, stlink_usb_init_buffer(), stlink_usb_read_trace(), stlink_usb_xfer_noerrcheck(), stlink_usb_handle_s::trace, and stlink_usb_handle_s::version.
|
static |
Definition at line 2311 of file stlink_usb.c.
References C_DEBUGEN, C_HALT, C_MASKINTS, C_STEP, stlink_usb_handle_s::cmdbuf, stlink_usb_handle_s::cmdidx, stlink_usb_handle_s::databuf, DBGKEY, DCB_DHCSR, stlink_usb_version::jtag_api, stlink_usb_handle_s::rx_ep, stlink_cmd_allow_retry(), STLINK_DEBUG_COMMAND, STLINK_DEBUG_STEPCORE, STLINK_JTAG_API_V1, stlink_usb_init_buffer(), stlink_usb_write_debug_reg(), and stlink_usb_handle_s::version.
|
static |
Definition at line 2184 of file stlink_usb.c.
References stlink_usb_handle_s::cmdbuf, stlink_usb_handle_s::cmdidx, stlink_usb_handle_s::databuf, stlink_usb_handle_s::enabled, ERROR_OK, stlink_usb_version::flags, LOG_DEBUG, stlink_usb_handle_s::rx_ep, STLINK_DEBUG_APIV2_STOP_TRACE_RX, STLINK_DEBUG_COMMAND, STLINK_F_HAS_TRACE, stlink_usb_init_buffer(), stlink_usb_xfer_errcheck(), stlink_usb_handle_s::trace, and stlink_usb_handle_s::version.
Referenced by stlink_config_trace(), and stlink_usb_reset().
|
static |
Definition at line 2206 of file stlink_usb.c.
References stlink_usb_handle_s::cmdbuf, stlink_usb_handle_s::cmdidx, stlink_usb_handle_s::databuf, stlink_usb_handle_s::enabled, ERROR_FAIL, ERROR_OK, stlink_usb_version::flags, h_u16_to_le(), h_u32_to_le(), LOG_DEBUG, LOG_ERROR, stlink_usb_handle_s::rx_ep, stlink_usb_handle_s::source_hz, STLINK_DEBUG_APIV2_START_TRACE_RX, STLINK_DEBUG_COMMAND, STLINK_F_HAS_TRACE, STLINK_TRACE_SIZE, stlink_usb_init_buffer(), stlink_usb_xfer_errcheck(), stlink_usb_handle_s::trace, and stlink_usb_handle_s::version.
Referenced by stlink_config_trace(), and stlink_usb_reset().
|
static |
Definition at line 2069 of file stlink_usb.c.
Referenced by stlink_dap_trace_read().
|
static |
Definition at line 3205 of file stlink_usb.c.
References stlink_usb_handle_s::cmdbuf, stlink_usb_handle_s::databuf, ERROR_OK, stlink_usb_priv_s::fd, jtag_libusb_close(), stlink_usb_exit_mode(), and stlink_usb_handle_s::usb_backend_priv.
|
static |
Definition at line 3351 of file stlink_usb.c.
References stlink_usb_handle_s::cmdbuf, stlink_usb_handle_s::databuf, ERROR_FAIL, ERROR_OK, stlink_usb_priv_s::fd, jtag_libusb_close(), jtag_libusb_get_pid(), jtag_libusb_open(), jtag_libusb_set_configuration(), LOG_DEBUG, LOG_ERROR, param, aice_port_param_s::pid, stlink_usb_handle_s::pid, stlink_usb_handle_s::rx_ep, stlink_usb_version::stlink, STLINK_DATA_SIZE, STLINK_RX_EP, STLINK_SG_SIZE, STLINK_TRACE_EP, STLINK_TX_EP, stlink_usb_get_alternate_serial(), stlink_usb_version(), STLINK_V1_PID, STLINK_V2_1_NO_MSD_PID, STLINK_V2_1_PID, STLINK_V2_1_TRACE_EP, STLINK_V2_1_TX_EP, STLINK_V2_PID, STLINK_V3_2VCP_PID, STLINK_V3_USBLOADER_PID, STLINK_V3E_NO_MSD_PID, STLINK_V3E_PID, STLINK_V3S_PID, stlink_usb_handle_s::trace_ep, stlink_usb_handle_s::tx_ep, stlink_usb_handle_s::usb_backend_priv, stlink_usb_handle_s::version, and aice_port_param_s::vid.
|
static |
Definition at line 859 of file stlink_usb.c.
References ERROR_FAIL, ERROR_OK, stlink_usb_priv_s::fd, jtag_libusb_bulk_read(), LOG_ERROR, size, STLINK_READ_TIMEOUT, stlink_usb_handle_s::trace_ep, and stlink_usb_handle_s::usb_backend_priv.
|
static |
Definition at line 880 of file stlink_usb.c.
References stlink_usb_handle_s::cmdbuf, stlink_usb_handle_s::cmdidx, ERROR_FAIL, ERROR_OK, LOG_DEBUG, size, stlink_usb_version::stlink, STLINK_CMD_SIZE_V2, STLINK_SG_SIZE, stlink_usb_xfer_rw(), stlink_usb_xfer_v1_get_sense(), stlink_usb_xfer_v1_get_status(), and stlink_usb_handle_s::version.
|
static |
Definition at line 2069 of file stlink_usb.c.
|
static |
Definition at line 2025 of file stlink_usb.c.
References addr, stlink_usb_handle_s::cmdbuf, stlink_usb_handle_s::cmdidx, stlink_usb_handle_s::databuf, ERROR_OK, h_u32_to_le(), le_to_h_u32(), stlink_usb_handle_s::rx_ep, stlink_cmd_allow_retry(), STLINK_DEBUG_APIV2_READDEBUGREG, STLINK_DEBUG_COMMAND, and stlink_usb_init_buffer().
Referenced by stlink_usb_read_reg().
|
static |
Definition at line 1249 of file stlink_usb.c.
References be_to_h_u16(), stlink_usb_handle_s::cmdbuf, stlink_usb_handle_s::cmdidx, stlink_usb_handle_s::databuf, ERROR_OK, stlink_usb_version::flags, stlink_usb_version::jtag, stlink_usb_version::jtag_api, le_to_h_u16(), LOG_INFO, stlink_usb_handle_s::pid, stlink_usb_handle_s::rx_ep, stlink_usb_version::stlink, STLINK_APIV3_GET_VERSION_EX, STLINK_F_FIX_CLOSE_AP, STLINK_F_HAS_AP_INIT, STLINK_F_HAS_DAP_REG, STLINK_F_HAS_DPBANKSEL, STLINK_F_HAS_GETLASTRWSTATUS2, STLINK_F_HAS_JTAG_SET_FREQ, STLINK_F_HAS_MEM_16BIT, STLINK_F_HAS_RW8_512BYTES, STLINK_F_HAS_SWD_SET_FREQ, STLINK_F_HAS_TRACE, STLINK_F_QUIRK_JTAG_DP_READ, STLINK_GET_VERSION, STLINK_JTAG_API_V1, STLINK_JTAG_API_V2, STLINK_JTAG_API_V3, stlink_usb_init_buffer(), stlink_usb_xfer_noerrcheck(), STLINK_V2_1_NO_MSD_PID, STLINK_V2_1_PID, stlink_usb_version::swim, stlink_usb_handle_s::version, and stlink_usb_handle_s::vid.
Referenced by stlink_usb_usb_open().
|
static |
Definition at line 2890 of file stlink_usb.c.
References addr, buffer, count, ERROR_OK, ERROR_WAIT, stlink_usb_version::flags, stlink_usb_handle_s::max_mem_packet, MAX_WAIT_RETRIES, size, STLINK_F_HAS_MEM_16BIT, stlink_max_block_size(), stlink_usb_block(), stlink_usb_write_mem16(), stlink_usb_write_mem32(), stlink_usb_write_mem8(), and stlink_usb_handle_s::version.
Referenced by stlink_usb_write_mem().
|
static |
Definition at line 2047 of file stlink_usb.c.
References addr, stlink_usb_handle_s::cmdbuf, stlink_usb_handle_s::cmdidx, stlink_usb_handle_s::databuf, h_u32_to_le(), stlink_usb_version::jtag_api, stlink_usb_handle_s::rx_ep, stlink_cmd_allow_retry(), STLINK_DEBUG_APIV1_WRITEDEBUGREG, STLINK_DEBUG_APIV2_WRITEDEBUGREG, STLINK_DEBUG_COMMAND, STLINK_JTAG_API_V1, stlink_usb_init_buffer(), and stlink_usb_handle_s::version.
Referenced by stlink_usb_halt(), stlink_usb_read_reg(), stlink_usb_run(), stlink_usb_step(), and stlink_usb_write_reg().
|
static |
Definition at line 2970 of file stlink_usb.c.
References addr, buffer, count, size, STLINK_HLA_AP_NUM, STLINK_HLA_CSW, and stlink_usb_write_ap_mem().
|
static |
Definition at line 2582 of file stlink_usb.c.
References addr, buffer, stlink_usb_handle_s::cmdbuf, stlink_usb_handle_s::cmdidx, ERROR_COMMAND_NOTFOUND, ERROR_FAIL, ERROR_OK, ERROR_TARGET_UNALIGNED_ACCESS, stlink_usb_version::flags, h_u16_to_le(), h_u24_to_le(), h_u32_to_le(), LOG_DEBUG, STLINK_DEBUG_APIV2_WRITEMEM_16BIT, STLINK_DEBUG_COMMAND, STLINK_F_HAS_CSW, STLINK_F_HAS_MEM_16BIT, STLINK_MAX_RW16_32, stlink_usb_get_rw_status(), stlink_usb_init_buffer(), stlink_usb_xfer_noerrcheck(), stlink_usb_handle_s::tx_ep, and stlink_usb_handle_s::version.
Referenced by stlink_usb_buf_rw_segment(), and stlink_usb_write_ap_mem().
|
static |
Definition at line 2673 of file stlink_usb.c.
References addr, buffer, stlink_usb_handle_s::cmdbuf, stlink_usb_handle_s::cmdidx, ERROR_COMMAND_NOTFOUND, ERROR_FAIL, ERROR_OK, ERROR_TARGET_UNALIGNED_ACCESS, stlink_usb_version::flags, h_u16_to_le(), h_u24_to_le(), h_u32_to_le(), LOG_DEBUG, STLINK_DEBUG_COMMAND, STLINK_DEBUG_WRITEMEM_32BIT, STLINK_F_HAS_CSW, STLINK_MAX_RW16_32, stlink_usb_get_rw_status(), stlink_usb_init_buffer(), stlink_usb_xfer_noerrcheck(), stlink_usb_handle_s::tx_ep, and stlink_usb_handle_s::version.
Referenced by stlink_usb_buf_rw_segment(), and stlink_usb_write_ap_mem().
|
static |
Definition at line 2757 of file stlink_usb.c.
References addr, buffer, stlink_usb_handle_s::cmdbuf, stlink_usb_handle_s::cmdidx, ERROR_COMMAND_NOTFOUND, ERROR_FAIL, ERROR_OK, ERROR_TARGET_UNALIGNED_ACCESS, stlink_usb_version::flags, h_u16_to_le(), h_u24_to_le(), h_u32_to_le(), LOG_DEBUG, NULL, STLINK_DEBUG_COMMAND, STLINK_DEBUG_WRITEMEM_32BIT_NO_ADDR_INC, STLINK_F_HAS_MEM_WR_NO_INC, STLINK_MAX_RW16_32, stlink_usb_get_rw_status(), stlink_usb_init_buffer(), stlink_usb_xfer_noerrcheck(), stlink_usb_handle_s::tx_ep, and stlink_usb_handle_s::version.
Referenced by stlink_usb_buf_rw_segment().
|
static |
Definition at line 2496 of file stlink_usb.c.
References addr, buffer, stlink_usb_handle_s::cmdbuf, stlink_usb_handle_s::cmdidx, ERROR_COMMAND_NOTFOUND, ERROR_FAIL, ERROR_OK, stlink_usb_version::flags, h_u16_to_le(), h_u24_to_le(), h_u32_to_le(), LOG_DEBUG, STLINK_DEBUG_COMMAND, STLINK_DEBUG_WRITEMEM_8BIT, STLINK_F_HAS_CSW, stlink_usb_block(), stlink_usb_get_rw_status(), stlink_usb_init_buffer(), stlink_usb_xfer_noerrcheck(), stlink_usb_handle_s::tx_ep, and stlink_usb_handle_s::version.
Referenced by stlink_usb_buf_rw_segment(), and stlink_usb_write_ap_mem().
|
static |
Definition at line 2400 of file stlink_usb.c.
References stlink_usb_handle_s::cmdbuf, stlink_usb_handle_s::cmdidx, stlink_usb_handle_s::databuf, DCB_DCRDR, DCB_DCRSR, DCRSR_WNR, ERROR_OK, stlink_usb_version::flags, h_u32_to_le(), stlink_usb_version::jtag_api, stlink_usb_handle_s::rx_ep, stlink_cmd_allow_retry(), STLINK_DEBUG_APIV1_WRITEREG, STLINK_DEBUG_APIV2_WRITEREG, STLINK_DEBUG_COMMAND, STLINK_F_HAS_FPU_REG, STLINK_JTAG_API_V1, STLINK_REGSEL_IS_FPU, stlink_usb_init_buffer(), stlink_usb_write_debug_reg(), and stlink_usb_handle_s::version.
|
static |
Definition at line 1139 of file stlink_usb.c.
References ERROR_OK, size, stlink_usb_error_check(), and stlink_usb_xfer_noerrcheck().
Referenced by stlink_get_com_freq(), stlink_read_dap_register(), stlink_set_com_freq(), stlink_usb_close_access_port(), stlink_usb_get_rw_status(), stlink_usb_idcode(), stlink_usb_init_access_port(), stlink_usb_read_regs(), stlink_usb_trace_disable(), and stlink_usb_trace_enable().
|
inlinestatic |
Definition at line 308 of file stlink_usb.c.
Referenced by __attribute__(), COMMAND_HANDLER(), stlink_cmd_allow_retry(), stlink_swim_readbytes(), stlink_swim_status(), stlink_usb_check_voltage(), stlink_usb_close_access_port(), stlink_usb_current_mode(), stlink_usb_idcode(), stlink_usb_mode_enter(), stlink_usb_mode_leave(), stlink_usb_read_mem16(), stlink_usb_read_mem32(), stlink_usb_read_mem32_noaddrinc(), stlink_usb_read_mem8(), stlink_usb_read_reg(), stlink_usb_read_regs(), stlink_usb_rw_misc_in(), stlink_usb_rw_misc_out(), stlink_usb_state(), stlink_usb_version(), stlink_usb_write_mem16(), stlink_usb_write_mem32(), stlink_usb_write_mem32_noaddrinc(), stlink_usb_write_mem8(), and stlink_usb_xfer_errcheck().
|
static |
Definition at line 799 of file stlink_usb.c.
References stlink_usb_handle_s::cmdbuf, stlink_usb_handle_s::direction, ERROR_FAIL, ERROR_OK, stlink_usb_priv_s::fd, jtag_libusb_bulk_read(), jtag_libusb_bulk_write(), LOG_DEBUG, stlink_usb_handle_s::rx_ep, size, STLINK_READ_TIMEOUT, STLINK_WRITE_TIMEOUT, stlink_usb_handle_s::tx_ep, and stlink_usb_handle_s::usb_backend_priv.
Referenced by stlink_usb_usb_xfer_noerrcheck(), and stlink_usb_xfer_v1_get_sense().
|
static |
Definition at line 1212 of file stlink_usb.c.
References buf_set_u32(), stlink_usb_handle_s::cmdbuf, stlink_usb_handle_s::cmdidx, direction, ENDPOINT_IN, ENDPOINT_OUT, stlink_usb_handle_s::rx_ep, and size.
Referenced by stlink_usb_init_buffer().
|
static |
Definition at line 832 of file stlink_usb.c.
References stlink_usb_handle_s::cmdbuf, stlink_usb_handle_s::cmdidx, stlink_usb_handle_s::databuf, ERROR_FAIL, ERROR_OK, REQUEST_SENSE, REQUEST_SENSE_LENGTH, stlink_usb_handle_s::rx_ep, stlink_usb_init_buffer(), stlink_usb_xfer_rw(), and stlink_usb_xfer_v1_get_status().
Referenced by stlink_usb_usb_xfer_noerrcheck().
|
static |
Definition at line 726 of file stlink_usb.c.
References buf_get_u32(), stlink_usb_handle_s::cmdbuf, ERROR_FAIL, ERROR_OK, stlink_usb_priv_s::fd, jtag_libusb_bulk_read(), stlink_usb_handle_s::rx_ep, STLINK_READ_TIMEOUT, STLINK_SG_SIZE, and stlink_usb_handle_s::usb_backend_priv.
Referenced by stlink_usb_usb_xfer_noerrcheck(), and stlink_usb_xfer_v1_get_sense().
|
static |
Definition at line 3976 of file stlink_usb.c.
Referenced by stlink_dap_ap_write(), and stlink_dap_dp_write().
|
static |
Definition at line 4045 of file stlink_usb.c.
Referenced by stlink_dap_op_connect(), stlink_dap_op_queue_ap_write(), and stlink_usb_open_ap().
struct adapter_driver stlink_dap_adapter_driver |
Definition at line 5182 of file stlink_usb.c.
|
static |
Definition at line 5000 of file stlink_usb.c.
|
static |
Definition at line 4046 of file stlink_usb.c.
Referenced by stlink_dap_get_and_clear_error(), stlink_dap_get_error(), and stlink_dap_record_error().
|
static |
Definition at line 4042 of file stlink_usb.c.
Referenced by COMMAND_HANDLER(), stlink_dap_ap_read(), stlink_dap_ap_write(), stlink_dap_closeall_ap(), stlink_dap_config_trace(), stlink_dap_dp_read(), stlink_dap_dp_write(), stlink_dap_init(), stlink_dap_khz(), stlink_dap_op_connect(), stlink_dap_op_queue_ap_read(), stlink_dap_op_queue_ap_write(), stlink_dap_op_queue_dp_read(), stlink_dap_op_queue_dp_write(), stlink_dap_open_ap(), stlink_dap_quit(), stlink_dap_reinit_interface(), stlink_dap_reset(), stlink_dap_run_finalize(), stlink_dap_run_internal(), stlink_dap_speed(), stlink_dap_trace_read(), stlink_swim_op_read_mem(), stlink_swim_op_reconnect(), stlink_swim_op_srst(), stlink_swim_op_write_mem(), stlink_usb_buf_rw_segment(), and stlink_usb_count_buf_rw_queue().
|
static |
Definition at line 5156 of file stlink_usb.c.
|
static |
Definition at line 4042 of file stlink_usb.c.
Referenced by COMMAND_HANDLER(), stlink_dap_init(), and stlink_dap_speed().
|
static |
Definition at line 5000 of file stlink_usb.c.
|
static |
Definition at line 5182 of file stlink_usb.c.
|
static |
Definition at line 308 of file stlink_usb.c.
Referenced by stlink_speed_jtag(), and stlink_usb_init_mode().
|
static |
Definition at line 308 of file stlink_usb.c.
Referenced by stlink_speed_swd(), and stlink_usb_init_mode().
|
static |
Definition at line 5156 of file stlink_usb.c.
|
static |
Definition at line 3460 of file stlink_usb.c.
Referenced by stlink_open(), and stlink_usb_count_misc_rw_queue().
|
static |
Definition at line 3460 of file stlink_usb.c.
Referenced by stlink_open().
struct hl_layout_api_s stlink_usb_layout_api |
Definition at line 3976 of file stlink_usb.c.