Specifies the @var{serial_string} of the adapter to use.
If this command is not specified, serial strings are not checked.
Only the following adapter drivers use the serial string from this command:
-cmsis_dap, ft232r, ftdi.
+cmsis_dap, ft232r, ftdi, kitprog.
The following adapters have their own command to specify the serial string:
-hla, jlink, kitprog, presto, st-link, vsllink, xds110.
+hla, jlink, presto, st-link, vsllink, xds110.
@end deffn
@section Interface Drivers
Please be aware that the acquisition sequence hard-resets the target.
@end deffn
-@deffn {Config Command} {kitprog_serial} serial
-Select a KitProg device by its @var{serial}. If left unspecified, the first
-device detected by OpenOCD will be used.
-@end deffn
-
@deffn {Command} {kitprog acquire_psoc}
Run a PSoC acquisition sequence immediately. Typically, this should not be used
outside of the target-specific configuration scripts since it hard-resets the
#include <hidapi.h>
+#include <jtag/adapter.h>
#include <jtag/interface.h>
#include <jtag/swd.h>
#include <jtag/commands.h>
void *buffer;
};
-static char *kitprog_serial;
static bool kitprog_init_acquire_psoc;
static int pending_transfer_count, pending_queue_len;
free(kitprog_handle->packet_buffer);
free(kitprog_handle->serial);
free(kitprog_handle);
- free(kitprog_serial);
free(pending_transfers);
return ERROR_OK;
const uint16_t vids[] = { VID, 0 };
const uint16_t pids[] = { PID, 0 };
- if (jtag_libusb_open(vids, pids, kitprog_serial,
+ if (jtag_libusb_open(vids, pids, adapter_get_required_serial(),
&kitprog_handle->usb_handle, NULL) != ERROR_OK) {
LOG_ERROR("Failed to open or find the device");
return ERROR_FAIL;
return retval;
}
-COMMAND_HANDLER(kitprog_handle_serial_command)
-{
- if (CMD_ARGC == 1) {
- kitprog_serial = strdup(CMD_ARGV[0]);
- if (!kitprog_serial) {
- LOG_ERROR("Failed to allocate memory for the serial number");
- return ERROR_FAIL;
- }
- } else {
- LOG_ERROR("expected exactly one argument to kitprog_serial <serial-number>");
- return ERROR_FAIL;
- }
-
- return ERROR_OK;
-}
-
COMMAND_HANDLER(kitprog_handle_init_acquire_psoc_command)
{
kitprog_init_acquire_psoc = true;
.usage = "<cmd>",
.chain = kitprog_subcommand_handlers,
},
- {
- .name = "kitprog_serial",
- .handler = &kitprog_handle_serial_command,
- .mode = COMMAND_CONFIG,
- .help = "set the serial number of the adapter",
- .usage = "serial_string",
- },
{
.name = "kitprog_init_acquire_psoc",
.handler = &kitprog_handle_init_acquire_psoc_command,