block_cmd);
unsigned int resp_size = cmsis_dap_tfer_resp_size(write_count, read_count,
block_cmd);
+ unsigned int max_transfer_count = block_cmd ? 65535 : 255;
/* Does the DAP Transfer command and the expected response fit into one packet?
* Run the queue also before a targetsel - it cannot be queued */
if (cmd_size > tfer_max_command_size
|| resp_size > tfer_max_response_size
- || targetsel_cmd) {
+ || targetsel_cmd
+ || write_count + read_count > max_transfer_count) {
if (cmsis_dap_handle->pending_fifo_block_count)
cmsis_dap_swd_read_process(cmsis_dap_handle, 0);
unsigned int s_len;
int retval;
- if ((output_pins & (SWJ_PIN_SRST | SWJ_PIN_TRST)) == (SWJ_PIN_SRST | SWJ_PIN_TRST)) {
+ if (seq != LINE_RESET &&
+ (output_pins & (SWJ_PIN_SRST | SWJ_PIN_TRST))
+ == (SWJ_PIN_SRST | SWJ_PIN_TRST)) {
/* Following workaround deasserts reset on most adapters.
* Do not reconnect if a reset line is active!
* Reconnecting would break connecting under reset. */
COMMAND_HANDLER(cmsis_dap_handle_vid_pid_command)
{
if (CMD_ARGC > MAX_USB_IDS * 2) {
- LOG_WARNING("ignoring extra IDs in cmsis_dap_vid_pid "
+ LOG_WARNING("ignoring extra IDs in cmsis-dap vid_pid "
"(maximum is %d pairs)", MAX_USB_IDS);
CMD_ARGC = MAX_USB_IDS * 2;
}
if (CMD_ARGC < 2 || (CMD_ARGC & 1)) {
- LOG_WARNING("incomplete cmsis_dap_vid_pid configuration directive");
+ LOG_WARNING("incomplete cmsis-dap vid_pid configuration directive");
if (CMD_ARGC < 2)
return ERROR_COMMAND_SYNTAX_ERROR;
/* remove the incomplete trailing id */
}
}
- LOG_ERROR("invalid backend argument to cmsis_dap_backend <backend>");
+ LOG_ERROR("invalid backend argument to cmsis-dap backend <backend>");
}
} else {
- LOG_ERROR("expected exactly one argument to cmsis_dap_backend <backend>");
+ LOG_ERROR("expected exactly one argument to cmsis-dap backend <backend>");
}
return ERROR_OK;
.usage = "",
.help = "issue cmsis-dap command",
},
- COMMAND_REGISTRATION_DONE
-};
-
-
-static const struct command_registration cmsis_dap_command_handlers[] = {
- {
- .name = "cmsis-dap",
- .mode = COMMAND_ANY,
- .help = "perform CMSIS-DAP management",
- .usage = "<cmd>",
- .chain = cmsis_dap_subcommand_handlers,
- },
{
- .name = "cmsis_dap_vid_pid",
+ .name = "vid_pid",
.handler = &cmsis_dap_handle_vid_pid_command,
.mode = COMMAND_CONFIG,
.help = "the vendor ID and product ID of the CMSIS-DAP device",
.usage = "(vid pid)*",
},
{
- .name = "cmsis_dap_backend",
+ .name = "backend",
.handler = &cmsis_dap_handle_backend_command,
.mode = COMMAND_CONFIG,
.help = "set the communication backend to use (USB bulk or HID).",
},
#if BUILD_CMSIS_DAP_USB
{
- .name = "cmsis_dap_usb",
+ .name = "usb",
.chain = cmsis_dap_usb_subcommand_handlers,
.mode = COMMAND_ANY,
.help = "USB bulk backend-specific commands",
COMMAND_REGISTRATION_DONE
};
+
+static const struct command_registration cmsis_dap_command_handlers[] = {
+ {
+ .name = "cmsis-dap",
+ .mode = COMMAND_ANY,
+ .help = "perform CMSIS-DAP management",
+ .usage = "<cmd>",
+ .chain = cmsis_dap_subcommand_handlers,
+ },
+ COMMAND_REGISTRATION_DONE
+};
+
static const struct swd_driver cmsis_dap_swd_driver = {
.init = cmsis_dap_swd_init,
.switch_seq = cmsis_dap_swd_switch_seq,