This command is only available if your libusb1 is at least version 1.0.16.
@end deffn
+@deffn {Config Command} {adapter serial} serial_string
+Specifies the @var{serial_string} of the adapter to use.
+If this command is not specified, serial strings are not checked.
+No adapter uses this command, so far.
+The following adapters have their own command to specify the serial string:
+cmsis_dap, ft232r, ftdi, hla, jlink, kitprog, presto, st-link, vsllink, xds110.
+@end deffn
+
@section Interface Drivers
Each of the interface drivers listed here must be explicitly
static struct {
bool adapter_initialized;
char *usb_location;
+ char *serial;
enum adapter_clk_mode clock_mode;
int speed_khz;
int rclk_fallback_speed_khz;
LOG_ERROR("failed: %d", result);
}
+ free(adapter_config.serial);
free(adapter_config.usb_location);
struct jtag_tap *t = jtag_all_taps();
return adapter_driver->speed_div(speed_var, khz);
}
+const char *adapter_get_required_serial(void)
+{
+ return adapter_config.serial;
+}
+
/*
* 1 char: bus
* 2 * 7 chars: max 7 ports
return retval;
}
+COMMAND_HANDLER(handle_adapter_serial_command)
+{
+ if (CMD_ARGC != 1)
+ return ERROR_COMMAND_SYNTAX_ERROR;
+
+ free(adapter_config.serial);
+ adapter_config.serial = strdup(CMD_ARGV[0]);
+ return ERROR_OK;
+}
+
COMMAND_HANDLER(handle_adapter_reset_de_assert)
{
enum values {
"With or without argument, display current setting.",
.usage = "[khz]",
},
+ {
+ .name = "serial",
+ .handler = handle_adapter_serial_command,
+ .mode = COMMAND_CONFIG,
+ .help = "Set the serial number of the adapter",
+ .usage = "serial_string",
+ },
{
.name = "list",
.handler = handle_adapter_list_command,
/** Retrieves the clock speed of the adapter in kHz. */
unsigned int adapter_get_speed_khz(void);
+/** Retrieves the serial number set with command 'adapter serial' */
+const char *adapter_get_required_serial(void);
+
#endif /* OPENOCD_JTAG_ADAPTER_H */