OpenOCD
|
Go to the source code of this file.
Data Structures | |
struct | nulink_usb_handle_s |
Macros | |
#define | ARM_SRAM_BASE 0x20000000UL |
#define | CMD_CHECK_ID 0xA3UL |
#define | CMD_CHECK_MCU_STOP 0xD8UL |
#define | CMD_MCU_FREE_RUN 0xD3UL |
#define | CMD_MCU_RESET 0xE2UL |
#define | CMD_MCU_STEP_RUN 0xD1UL |
#define | CMD_MCU_STOP_RUN 0xD2UL |
#define | CMD_READ_RAM 0xB1UL |
#define | CMD_READ_REG 0xB5UL |
#define | CMD_SET_CONFIG 0xA2UL |
#define | CMD_WRITE_RAM 0xB9UL |
#define | CMD_WRITE_REG 0xB8UL |
#define | HARDWARE_CONFIG_NULINK2 2 |
#define | HARDWARE_CONFIG_NULINKPRO 1 |
#define | NULINK2_HID_MAX_SIZE (1024) |
#define | NULINK2_USB_PID1 (0x5200) |
#define | NULINK2_USB_PID2 (0x5201) |
#define | NULINK_HID_MAX_SIZE (64) |
#define | NULINK_READ_TIMEOUT LIBUSB_TIMEOUT_MS |
#define | V6M_MAX_COMMAND_LENGTH (NULINK_HID_MAX_SIZE - 2) |
#define | V7M_MAX_COMMAND_LENGTH (NULINK_HID_MAX_SIZE - 3) |
Enumerations | |
enum | nulink_connect { CONNECT_NORMAL = 0 , CONNECT_PRE_RESET = 1 , CONNECT_UNDER_RESET = 2 , CONNECT_NONE = 3 , CONNECT_DISCONNECT = 4 , CONNECT_ICP_MODE = 5 } |
enum | nulink_reset { RESET_AUTO = 0 , RESET_HW = 1 , RESET_SYSRESETREQ = 2 , RESET_VECTRESET = 3 , RESET_FAST_RESCUE = 4 } |
Functions | |
static void | nulink1_usb_init_buffer (void *handle, uint32_t size) |
static int | nulink1_usb_xfer (void *handle, uint8_t *buf, int size) |
static void | nulink2_usb_init_buffer (void *handle, uint32_t size) |
static int | nulink2_usb_xfer (void *handle, uint8_t *buf, int size) |
static uint32_t | nulink_max_block_size (uint32_t tar_autoincr_block, uint32_t address) |
static int | nulink_speed (void *handle, int khz, bool query) |
static int | nulink_usb_assert_srst (void *handle, int srst) |
static int | nulink_usb_close (void *handle) |
static int | nulink_usb_halt (void *handle) |
static int | nulink_usb_idcode (void *handle, uint32_t *idcode) |
static void | nulink_usb_init_buffer (void *handle, uint32_t size) |
static int | nulink_usb_open (struct hl_interface_param_s *param, void **fd) |
static int | nulink_usb_override_target (const char *targetname) |
static int | nulink_usb_read_mem (void *handle, uint32_t addr, uint32_t size, uint32_t count, uint8_t *buffer) |
static int | nulink_usb_read_mem32 (void *handle, uint32_t addr, uint16_t len, uint8_t *buffer) |
static int | nulink_usb_read_mem8 (void *handle, uint32_t addr, uint16_t len, uint8_t *buffer) |
static int | nulink_usb_read_reg (void *handle, unsigned int regsel, uint32_t *val) |
static int | nulink_usb_reset (void *handle) |
static int | nulink_usb_run (void *handle) |
static enum target_state | nulink_usb_state (void *handle) |
static int | nulink_usb_step (void *handle) |
static int | nulink_usb_version (void *handle) |
static int | nulink_usb_write_debug_reg (void *handle, uint32_t addr, uint32_t val) |
static int | nulink_usb_write_mem (void *handle, uint32_t addr, uint32_t size, uint32_t count, const uint8_t *buffer) |
static int | nulink_usb_write_mem32 (void *handle, uint32_t addr, uint16_t len, const uint8_t *buffer) |
static int | nulink_usb_write_mem8 (void *handle, uint32_t addr, uint16_t len, const uint8_t *buffer) |
static int | nulink_usb_write_reg (void *handle, unsigned int regsel, uint32_t val) |
static int | nulink_usb_xfer (void *handle, uint8_t *buf, int size) |
static int | nulink_usb_xfer_rw (void *handle, uint8_t *buf) |
Variables | |
struct hl_layout_api_s | nulink_usb_layout_api |
#define ARM_SRAM_BASE 0x20000000UL |
Definition at line 66 of file nulink_usb.c.
#define CMD_CHECK_ID 0xA3UL |
Definition at line 58 of file nulink_usb.c.
#define CMD_CHECK_MCU_STOP 0xD8UL |
Definition at line 60 of file nulink_usb.c.
#define CMD_MCU_FREE_RUN 0xD3UL |
Definition at line 63 of file nulink_usb.c.
#define CMD_MCU_RESET 0xE2UL |
Definition at line 59 of file nulink_usb.c.
#define CMD_MCU_STEP_RUN 0xD1UL |
Definition at line 61 of file nulink_usb.c.
#define CMD_MCU_STOP_RUN 0xD2UL |
Definition at line 62 of file nulink_usb.c.
#define CMD_READ_RAM 0xB1UL |
Definition at line 55 of file nulink_usb.c.
#define CMD_READ_REG 0xB5UL |
Definition at line 54 of file nulink_usb.c.
#define CMD_SET_CONFIG 0xA2UL |
Definition at line 64 of file nulink_usb.c.
#define CMD_WRITE_RAM 0xB9UL |
Definition at line 57 of file nulink_usb.c.
#define CMD_WRITE_REG 0xB8UL |
Definition at line 56 of file nulink_usb.c.
#define HARDWARE_CONFIG_NULINK2 2 |
Definition at line 69 of file nulink_usb.c.
#define HARDWARE_CONFIG_NULINKPRO 1 |
Definition at line 68 of file nulink_usb.c.
#define NULINK2_HID_MAX_SIZE (1024) |
Definition at line 30 of file nulink_usb.c.
#define NULINK2_USB_PID1 (0x5200) |
Definition at line 34 of file nulink_usb.c.
#define NULINK2_USB_PID2 (0x5201) |
Definition at line 35 of file nulink_usb.c.
#define NULINK_HID_MAX_SIZE (64) |
Definition at line 29 of file nulink_usb.c.
#define NULINK_READ_TIMEOUT LIBUSB_TIMEOUT_MS |
Definition at line 27 of file nulink_usb.c.
#define V6M_MAX_COMMAND_LENGTH (NULINK_HID_MAX_SIZE - 2) |
Definition at line 31 of file nulink_usb.c.
#define V7M_MAX_COMMAND_LENGTH (NULINK_HID_MAX_SIZE - 3) |
Definition at line 32 of file nulink_usb.c.
enum nulink_connect |
Enumerator | |
---|---|
CONNECT_NORMAL | |
CONNECT_PRE_RESET | |
CONNECT_UNDER_RESET | |
CONNECT_NONE | |
CONNECT_DISCONNECT | |
CONNECT_ICP_MODE |
Definition at line 79 of file nulink_usb.c.
enum nulink_reset |
Enumerator | |
---|---|
RESET_AUTO | |
RESET_HW | |
RESET_SYSRESETREQ | |
RESET_VECTRESET | |
RESET_FAST_RESCUE |
Definition at line 71 of file nulink_usb.c.
|
static |
Definition at line 134 of file nulink_usb.c.
References nulink_usb_handle_s::cmdbuf, nulink_usb_handle_s::cmdidx, nulink_usb_handle_s::databuf, nulink_usb_handle_s::max_packet_size, size, nulink_usb_handle_s::tempbuf, and nulink_usb_handle_s::usbcmdidx.
|
static |
Definition at line 108 of file nulink_usb.c.
References nulink_usb_xfer_rw(), nulink_usb_handle_s::tempbuf, and V6M_MAX_COMMAND_LENGTH.
|
static |
Definition at line 150 of file nulink_usb.c.
References nulink_usb_handle_s::cmdbuf, nulink_usb_handle_s::cmdidx, nulink_usb_handle_s::databuf, h_u16_to_le(), nulink_usb_handle_s::max_packet_size, size, nulink_usb_handle_s::tempbuf, and nulink_usb_handle_s::usbcmdidx.
|
static |
Definition at line 121 of file nulink_usb.c.
References nulink_usb_xfer_rw(), nulink_usb_handle_s::tempbuf, and V7M_MAX_COMMAND_LENGTH.
|
static |
Definition at line 808 of file nulink_usb.c.
Referenced by nulink_usb_read_mem(), and nulink_usb_write_mem().
|
static |
Definition at line 951 of file nulink_usb.c.
References CMD_SET_CONFIG, nulink_usb_handle_s::cmdbuf, nulink_usb_handle_s::cmdidx, nulink_usb_handle_s::databuf, h_u32_to_le(), nulink_usb_handle_s::hardware_config, HARDWARE_CONFIG_NULINKPRO, le_to_h_u16(), LOG_DEBUG, LOG_INFO, nulink_usb_init_buffer(), and nulink_usb_xfer().
|
static |
Definition at line 300 of file nulink_usb.c.
References CMD_MCU_RESET, nulink_usb_handle_s::cmdbuf, nulink_usb_handle_s::cmdidx, CONNECT_NORMAL, nulink_usb_handle_s::databuf, h_u32_to_le(), LOG_DEBUG, nulink_usb_init_buffer(), nulink_usb_xfer(), and RESET_SYSRESETREQ.
|
static |
Definition at line 1005 of file nulink_usb.c.
References nulink_usb_handle_s::dev_handle, ERROR_OK, and LOG_DEBUG.
|
static |
Definition at line 366 of file nulink_usb.c.
References CMD_MCU_STOP_RUN, nulink_usb_handle_s::cmdbuf, nulink_usb_handle_s::cmdidx, nulink_usb_handle_s::databuf, h_u32_to_le(), le_to_h_u32(), LOG_DEBUG, nulink_usb_init_buffer(), and nulink_usb_xfer().
|
static |
Definition at line 220 of file nulink_usb.c.
References CMD_CHECK_ID, nulink_usb_handle_s::cmdbuf, nulink_usb_handle_s::cmdidx, nulink_usb_handle_s::databuf, ERROR_OK, h_u32_to_le(), le_to_h_u32(), LOG_DEBUG, LOG_INFO, nulink_usb_init_buffer(), and nulink_usb_xfer().
|
inlinestatic |
Definition at line 175 of file nulink_usb.c.
References nulink_usb_handle_s::init_buffer, and size.
Referenced by nulink_speed(), nulink_usb_assert_srst(), nulink_usb_halt(), nulink_usb_idcode(), nulink_usb_read_mem32(), nulink_usb_read_mem8(), nulink_usb_read_reg(), nulink_usb_reset(), nulink_usb_run(), nulink_usb_state(), nulink_usb_step(), nulink_usb_version(), nulink_usb_write_mem32(), nulink_usb_write_mem8(), and nulink_usb_write_reg().
|
static |
Definition at line 1021 of file nulink_usb.c.
|
static |
Definition at line 944 of file nulink_usb.c.
References LOG_DEBUG.
|
static |
Definition at line 818 of file nulink_usb.c.
References addr, buffer, count, ERROR_OK, nulink_usb_handle_s::max_mem_packet, nulink_max_block_size(), nulink_usb_read_mem32(), nulink_usb_read_mem8(), and size.
|
static |
Definition at line 673 of file nulink_usb.c.
References addr, buffer, CMD_WRITE_RAM, nulink_usb_handle_s::cmdbuf, nulink_usb_handle_s::cmdidx, count, nulink_usb_handle_s::databuf, ERROR_OK, ERROR_TARGET_UNALIGNED_ACCESS, h_u32_to_le(), LOG_ERROR, nulink_usb_init_buffer(), and nulink_usb_xfer().
Referenced by nulink_usb_read_mem().
|
static |
Definition at line 480 of file nulink_usb.c.
References addr, buffer, CMD_WRITE_RAM, nulink_usb_handle_s::cmdbuf, nulink_usb_handle_s::cmdidx, count, nulink_usb_handle_s::databuf, ERROR_OK, h_u32_to_le(), LOG_DEBUG, nulink_usb_init_buffer(), nulink_usb_xfer(), and offset.
Referenced by nulink_usb_read_mem().
|
static |
Definition at line 406 of file nulink_usb.c.
References CMD_WRITE_REG, nulink_usb_handle_s::cmdbuf, nulink_usb_handle_s::cmdidx, nulink_usb_handle_s::databuf, h_u32_to_le(), le_to_h_u32(), nulink_usb_init_buffer(), and nulink_usb_xfer().
|
static |
Definition at line 325 of file nulink_usb.c.
References CMD_MCU_RESET, nulink_usb_handle_s::cmdbuf, nulink_usb_handle_s::cmdidx, CONNECT_NORMAL, nulink_usb_handle_s::databuf, h_u32_to_le(), LOG_DEBUG, nulink_usb_init_buffer(), nulink_usb_xfer(), and RESET_HW.
|
static |
Definition at line 350 of file nulink_usb.c.
References CMD_MCU_FREE_RUN, nulink_usb_handle_s::cmdbuf, nulink_usb_handle_s::cmdidx, nulink_usb_handle_s::databuf, h_u32_to_le(), LOG_DEBUG, nulink_usb_init_buffer(), and nulink_usb_xfer().
|
static |
Definition at line 244 of file nulink_usb.c.
References addr, CMD_WRITE_RAM, nulink_usb_handle_s::cmdbuf, nulink_usb_handle_s::cmdidx, nulink_usb_handle_s::databuf, h_u32_to_le(), LOG_DEBUG, nulink_usb_init_buffer(), and nulink_usb_xfer().
|
static |
Definition at line 386 of file nulink_usb.c.
References CMD_MCU_STEP_RUN, nulink_usb_handle_s::cmdbuf, nulink_usb_handle_s::cmdidx, nulink_usb_handle_s::databuf, h_u32_to_le(), le_to_h_u32(), LOG_DEBUG, nulink_usb_init_buffer(), and nulink_usb_xfer().
|
static |
Definition at line 184 of file nulink_usb.c.
References nulink_usb_handle_s::cmdbuf, nulink_usb_handle_s::cmdidx, nulink_usb_handle_s::cmdsize, nulink_usb_handle_s::databuf, ERROR_OK, nulink_usb_handle_s::hardware_config, HARDWARE_CONFIG_NULINKPRO, le_to_h_u16(), le_to_h_u32(), LOG_DEBUG, LOG_INFO, nulink_usb_init_buffer(), nulink_usb_xfer(), and V6M_MAX_COMMAND_LENGTH.
|
static |
Definition at line 244 of file nulink_usb.c.
|
static |
Definition at line 878 of file nulink_usb.c.
References addr, ARM_SRAM_BASE, buffer, count, ERROR_OK, LOG_DEBUG, nulink_usb_handle_s::max_mem_packet, nulink_max_block_size(), nulink_usb_write_mem32(), nulink_usb_write_mem8(), and size.
|
static |
Definition at line 742 of file nulink_usb.c.
References addr, buf_get_u32(), buffer, CMD_WRITE_RAM, nulink_usb_handle_s::cmdbuf, nulink_usb_handle_s::cmdidx, count, nulink_usb_handle_s::databuf, ERROR_OK, ERROR_TARGET_UNALIGNED_ACCESS, h_u32_to_le(), LOG_ERROR, nulink_usb_init_buffer(), and nulink_usb_xfer().
Referenced by nulink_usb_write_mem().
|
static |
Definition at line 565 of file nulink_usb.c.
References addr, buf_get_u32(), buffer, CMD_WRITE_RAM, nulink_usb_handle_s::cmdbuf, nulink_usb_handle_s::cmdidx, count, nulink_usb_handle_s::databuf, ERROR_OK, h_u32_to_le(), LOG_DEBUG, nulink_usb_init_buffer(), nulink_usb_xfer(), and offset.
Referenced by nulink_usb_write_mem().
|
static |
Definition at line 445 of file nulink_usb.c.
References CMD_WRITE_REG, nulink_usb_handle_s::cmdbuf, nulink_usb_handle_s::cmdidx, nulink_usb_handle_s::databuf, h_u32_to_le(), nulink_usb_init_buffer(), and nulink_usb_xfer().
|
inlinestatic |
Definition at line 166 of file nulink_usb.c.
References size, and nulink_usb_handle_s::xfer.
Referenced by nulink_speed(), nulink_usb_assert_srst(), nulink_usb_halt(), nulink_usb_idcode(), nulink_usb_read_mem32(), nulink_usb_read_mem8(), nulink_usb_read_reg(), nulink_usb_reset(), nulink_usb_run(), nulink_usb_state(), nulink_usb_step(), nulink_usb_version(), nulink_usb_write_mem32(), nulink_usb_write_mem8(), and nulink_usb_write_reg().
|
static |
Definition at line 88 of file nulink_usb.c.
References nulink_usb_handle_s::cmdbuf, nulink_usb_handle_s::dev_handle, ERROR_FAIL, ERROR_OK, LOG_ERROR, nulink_usb_handle_s::max_packet_size, and NULINK_READ_TIMEOUT.
Referenced by nulink1_usb_xfer(), and nulink2_usb_xfer().
struct hl_layout_api_s nulink_usb_layout_api |
Definition at line 1021 of file nulink_usb.c.