This enables us to change the target name without breaking any
target scripts.
Change-Id: I635f961e573264d3dab2560f3a803ef1986ccfde
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/919
Tested-by: jenkins
19 files changed:
AC_ARG_ENABLE([stlink],
AS_HELP_STRING([--enable-stlink], [Enable building support for the ST-Link JTAG Programmer]),
AC_ARG_ENABLE([stlink],
AS_HELP_STRING([--enable-stlink], [Enable building support for the ST-Link JTAG Programmer]),
- [build_stlink=$enableval], [build_stlink=no])
+ [build_hladapter=$enableval], [build_hladapter=no])
AC_ARG_ENABLE([osbdm],
AS_HELP_STRING([--enable-osbdm], [Enable building support for the OSBDM (JTAG only) Programmer]),
AC_ARG_ENABLE([osbdm],
AS_HELP_STRING([--enable-osbdm], [Enable building support for the OSBDM (JTAG only) Programmer]),
AC_DEFINE([BUILD_BUSPIRATE], [0], [0 if you don't want the Buspirate JTAG driver.])
fi
AC_DEFINE([BUILD_BUSPIRATE], [0], [0 if you don't want the Buspirate JTAG driver.])
fi
-if test $build_stlink = yes; then
- AC_DEFINE([BUILD_STLINK], [1], [1 if you want the ST-Link JTAG driver.])
+if test $build_hladapter = yes; then
+ AC_DEFINE([BUILD_HLADAPTER], [1], [1 if you want the ST-Link JTAG driver.])
- AC_DEFINE([BUILD_STLINK], [0], [0 if you don't want the ST-Link JTAG driver.])
+ AC_DEFINE([BUILD_HLADAPTER], [0], [0 if you don't want the ST-Link JTAG driver.])
fi
if test $build_osbdm = yes; then
fi
if test $build_osbdm = yes; then
# Check for libusb1 ported drivers.
build_usb_ng=no
# Check for libusb1 ported drivers.
build_usb_ng=no
-if test $build_jlink = yes -o $build_stlink = yes -o $build_osbdm = yes -o \
+if test $build_jlink = yes -o $build_hladapter = yes -o $build_osbdm = yes -o \
$build_opendous = yes -o $build_ftdi = yes
then
build_usb_ng=yes
$build_opendous = yes -o $build_ftdi = yes
then
build_usb_ng=yes
AM_CONDITIONAL([ARMJTAGEW], [test $build_armjtagew = yes])
AM_CONDITIONAL([REMOTE_BITBANG], [test $build_remote_bitbang = yes])
AM_CONDITIONAL([BUSPIRATE], [test $build_buspirate = yes])
AM_CONDITIONAL([ARMJTAGEW], [test $build_armjtagew = yes])
AM_CONDITIONAL([REMOTE_BITBANG], [test $build_remote_bitbang = yes])
AM_CONDITIONAL([BUSPIRATE], [test $build_buspirate = yes])
-AM_CONDITIONAL([STLINK], [test $build_stlink = yes])
+AM_CONDITIONAL([HLADAPTER], [test $build_hladapter = yes])
AM_CONDITIONAL([OSBDM], [test $build_osbdm = yes])
AM_CONDITIONAL([OPENDOUS], [test $build_opendous = yes])
AM_CONDITIONAL([SYSFSGPIO], [test $build_sysfsgpio = yes])
AM_CONDITIONAL([OSBDM], [test $build_osbdm = yes])
AM_CONDITIONAL([OPENDOUS], [test $build_opendous = yes])
AM_CONDITIONAL([SYSFSGPIO], [test $build_sysfsgpio = yes])
src/helper/Makefile
src/jtag/Makefile
src/jtag/drivers/Makefile
src/helper/Makefile
src/jtag/Makefile
src/jtag/drivers/Makefile
- src/jtag/stlink/Makefile
src/transport/Makefile
src/xsvf/Makefile
src/svf/Makefile
src/transport/Makefile
src/xsvf/Makefile
src/svf/Makefile
MINIDRIVER_IMP_DIR = $(srcdir)/drivers
DRIVERFILES += commands.c
MINIDRIVER_IMP_DIR = $(srcdir)/drivers
DRIVERFILES += commands.c
-if STLINK
-SUBDIRS += stlink
-libjtag_la_LIBADD += $(top_builddir)/src/jtag/stlink/libocdstlink.la
+if HLADAPTER
+SUBDIRS += hla
+libjtag_la_LIBADD += $(top_builddir)/src/jtag/hla/libocdhla.la
if REMOTE_BITBANG
DRIVERFILES += remote_bitbang.c
endif
if REMOTE_BITBANG
DRIVERFILES += remote_bitbang.c
endif
DRIVERFILES += stlink_usb.c
endif
if OSBDM
DRIVERFILES += stlink_usb.c
endif
if OSBDM
/* project specific includes */
#include <helper/binarybuffer.h>
#include <jtag/interface.h>
/* project specific includes */
#include <helper/binarybuffer.h>
#include <jtag/interface.h>
-#include <jtag/stlink/stlink_layout.h>
-#include <jtag/stlink/stlink_transport.h>
-#include <jtag/stlink/stlink_interface.h>
+#include <jtag/hla/hla_layout.h>
+#include <jtag/hla/hla_transport.h>
+#include <jtag/hla/hla_interface.h>
#include <target/target.h>
#include <target/cortex_m.h>
#include <target/target.h>
#include <target/cortex_m.h>
/** */
uint8_t databuf[STLINK_DATA_SIZE];
/** */
/** */
uint8_t databuf[STLINK_DATA_SIZE];
/** */
- enum stlink_transports transport;
+ enum hl_transports transport;
/** */
struct stlink_usb_version version;
/** */
/** */
struct stlink_usb_version version;
/** */
/* set selected mode */
switch (h->transport) {
/* set selected mode */
switch (h->transport) {
- case STLINK_TRANSPORT_SWD:
emode = STLINK_MODE_DEBUG_SWD;
break;
emode = STLINK_MODE_DEBUG_SWD;
break;
- case STLINK_TRANSPORT_JTAG:
+ case HL_TRANSPORT_JTAG:
emode = STLINK_MODE_DEBUG_JTAG;
break;
emode = STLINK_MODE_DEBUG_JTAG;
break;
- case STLINK_TRANSPORT_SWIM:
+ case HL_TRANSPORT_SWIM:
emode = STLINK_MODE_DEBUG_SWIM;
break;
default:
emode = STLINK_MODE_DEBUG_SWIM;
break;
default:
-static int stlink_usb_open(struct stlink_interface_param_s *param, void **fd)
+static int stlink_usb_open(struct hl_interface_param_s *param, void **fd)
{
int err;
struct stlink_usb_handle_s *h;
{
int err;
struct stlink_usb_handle_s *h;
err = ERROR_OK;
switch (h->transport) {
err = ERROR_OK;
switch (h->transport) {
- case STLINK_TRANSPORT_SWD:
- case STLINK_TRANSPORT_JTAG:
+ case HL_TRANSPORT_SWD:
+ case HL_TRANSPORT_JTAG:
if (h->version.jtag == 0)
err = ERROR_FAIL;
break;
if (h->version.jtag == 0)
err = ERROR_FAIL;
break;
- case STLINK_TRANSPORT_SWIM:
+ case HL_TRANSPORT_SWIM:
if (h->version.swim == 0)
err = ERROR_FAIL;
break;
if (h->version.swim == 0)
err = ERROR_FAIL;
break;
-struct stlink_layout_api_s stlink_usb_layout_api = {
+struct hl_layout_api_s stlink_usb_layout_api = {
/** */
.open = stlink_usb_open,
/** */
/** */
.open = stlink_usb_open,
/** */
--- /dev/null
+include $(top_srcdir)/common.mk
+
+noinst_LTLIBRARIES = libocdhla.la
+
+libocdhla_la_SOURCES = \
+ $(HLFILES)
+
+HLFILES =
+
+if HLADAPTER
+HLFILES += hla_transport.c
+HLFILES += hla_tcl.c
+HLFILES += hla_interface.c
+HLFILES += hla_layout.c
+endif
+
+noinst_HEADERS = \
+ hla_interface.h \
+ hla_layout.h \
+ hla_tcl.h \
+ hla_transport.h
+
+MAINTAINERCLEANFILES = $(srcdir)/Makefile.in
* Copyright (C) 2011 by Mathias Kuester *
* Mathias Kuester <kesmtp@freenet.de> *
* *
* Copyright (C) 2011 by Mathias Kuester *
* Mathias Kuester <kesmtp@freenet.de> *
* *
+ * Copyright (C) 2012 by Spencer Oliver *
+ * spen@spen-soft.co.uk *
+ * *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
#include <transport/transport.h>
#include <helper/time_support.h>
#include <transport/transport.h>
#include <helper/time_support.h>
-#include <jtag/stlink/stlink_tcl.h>
-#include <jtag/stlink/stlink_layout.h>
-#include <jtag/stlink/stlink_transport.h>
-#include <jtag/stlink/stlink_interface.h>
+#include <jtag/hla/hla_tcl.h>
+#include <jtag/hla/hla_layout.h>
+#include <jtag/hla/hla_transport.h>
+#include <jtag/hla/hla_interface.h>
#include <target/target.h>
#include <target/target.h>
-static struct stlink_interface_s stlink_if = { {0, 0, 0, 0, 0, 0}, 0, 0 };
+static struct hl_interface_s hl_if = { {0, 0, 0, 0, 0, 0}, 0, 0 };
-int stlink_interface_open(enum stlink_transports tr)
+int hl_interface_open(enum hl_transports tr)
- LOG_DEBUG("stlink_interface_open");
+ LOG_DEBUG("hl_interface_open");
- stlink_if.param.transport = tr;
+ hl_if.param.transport = tr;
- int result = stlink_if.layout->open(&stlink_if);
+ int result = hl_if.layout->open(&hl_if);
if (result != ERROR_OK)
return result;
if (result != ERROR_OK)
return result;
- return stlink_interface_init_reset();
+ return hl_interface_init_reset();
-int stlink_interface_init_target(struct target *t)
+int hl_interface_init_target(struct target *t)
- LOG_DEBUG("stlink_interface_init_target");
+ LOG_DEBUG("hl_interface_init_target");
/* this is the interface for the current target and we
* can setup the private pointer in the tap structure
* if the interface match the tap idcode
*/
/* this is the interface for the current target and we
* can setup the private pointer in the tap structure
* if the interface match the tap idcode
*/
- res = stlink_if.layout->api->idcode(stlink_if.fd, &t->tap->idcode);
+ res = hl_if.layout->api->idcode(hl_if.fd, &t->tap->idcode);
if (res != ERROR_OK)
return res;
if (res != ERROR_OK)
return res;
- LOG_ERROR("stlink_interface_init_target: target not found: idcode: 0x%08x",
+ LOG_ERROR("hl_interface_init_target: target not found: idcode: 0x%08x",
t->tap->idcode);
return ERROR_FAIL;
}
t->tap->idcode);
return ERROR_FAIL;
}
- t->tap->priv = &stlink_if;
t->tap->hasidcode = 1;
return ERROR_OK;
}
t->tap->hasidcode = 1;
return ERROR_OK;
}
-static int stlink_interface_init(void)
+static int hl_interface_init(void)
- LOG_DEBUG("stlink_interface_init");
+ LOG_DEBUG("hl_interface_init");
/* here we can initialize the layout */
/* here we can initialize the layout */
- return stlink_layout_init(&stlink_if);
+ return hl_layout_init(&hl_if);
-static int stlink_interface_quit(void)
+static int hl_interface_quit(void)
- LOG_DEBUG("stlink_interface_quit");
+ LOG_DEBUG("hl_interface_quit");
-static int stlink_interface_speed(int speed)
+static int hl_interface_speed(int speed)
- LOG_DEBUG("stlink_interface_speed: ignore speed %d", speed);
+ LOG_DEBUG("hl_interface_speed: ignore speed %d", speed);
-static int stlink_speed_div(int speed, int *khz)
+static int hl_speed_div(int speed, int *khz)
{
*khz = speed;
return ERROR_OK;
}
{
*khz = speed;
return ERROR_OK;
}
-static int stlink_khz(int khz, int *jtag_speed)
+static int hl_khz(int khz, int *jtag_speed)
{
*jtag_speed = khz;
return ERROR_OK;
}
{
*jtag_speed = khz;
return ERROR_OK;
}
-static int stlink_interface_execute_queue(void)
+static int hl_interface_execute_queue(void)
- LOG_DEBUG("stlink_interface_execute_queue: ignored");
+ LOG_DEBUG("hl_interface_execute_queue: ignored");
-int stlink_interface_init_reset(void)
+int hl_interface_init_reset(void)
{
enum reset_types jtag_reset_config = jtag_get_reset_config();
if (jtag_reset_config & RESET_CNCT_UNDER_SRST) {
if (jtag_reset_config & RESET_SRST_NO_GATING) {
jtag_add_reset(0, 1);
{
enum reset_types jtag_reset_config = jtag_get_reset_config();
if (jtag_reset_config & RESET_CNCT_UNDER_SRST) {
if (jtag_reset_config & RESET_SRST_NO_GATING) {
jtag_add_reset(0, 1);
- stlink_if.layout->api->assert_srst(stlink_if.fd, 0);
+ hl_if.layout->api->assert_srst(hl_if.fd, 0);
} else
LOG_WARNING("\'srst_nogate\' reset_config option is required");
}
} else
LOG_WARNING("\'srst_nogate\' reset_config option is required");
}
-COMMAND_HANDLER(stlink_interface_handle_device_desc_command)
+COMMAND_HANDLER(hl_interface_handle_device_desc_command)
- LOG_DEBUG("stlink_interface_handle_device_desc_command");
+ LOG_DEBUG("hl_interface_handle_device_desc_command");
- stlink_if.param.device_desc = strdup(CMD_ARGV[0]);
+ hl_if.param.device_desc = strdup(CMD_ARGV[0]);
- LOG_ERROR
- ("expected exactly one argument to stlink_device_desc <description>");
+ LOG_ERROR("expected exactly one argument to hl_device_desc <description>");
-COMMAND_HANDLER(stlink_interface_handle_serial_command)
+COMMAND_HANDLER(hl_interface_handle_serial_command)
- LOG_DEBUG("stlink_interface_handle_serial_command");
+ LOG_DEBUG("hl_interface_handle_serial_command");
- stlink_if.param.serial = strdup(CMD_ARGV[0]);
+ hl_if.param.serial = strdup(CMD_ARGV[0]);
- LOG_ERROR
- ("expected exactly one argument to stlink_serial <serial-number>");
+ LOG_ERROR("expected exactly one argument to hl_serial <serial-number>");
-COMMAND_HANDLER(stlink_interface_handle_layout_command)
+COMMAND_HANDLER(hl_interface_handle_layout_command)
- LOG_DEBUG("stlink_interface_handle_layout_command");
+ LOG_DEBUG("hl_interface_handle_layout_command");
if (CMD_ARGC != 1) {
LOG_ERROR("Need exactly one argument to stlink_layout");
return ERROR_COMMAND_SYNTAX_ERROR;
}
if (CMD_ARGC != 1) {
LOG_ERROR("Need exactly one argument to stlink_layout");
return ERROR_COMMAND_SYNTAX_ERROR;
}
- if (stlink_if.layout) {
- LOG_ERROR("already specified stlink_layout %s",
- stlink_if.layout->name);
- return (strcmp(stlink_if.layout->name, CMD_ARGV[0]) != 0)
+ if (hl_if.layout) {
+ LOG_ERROR("already specified hl_layout %s",
+ hl_if.layout->name);
+ return (strcmp(hl_if.layout->name, CMD_ARGV[0]) != 0)
? ERROR_FAIL : ERROR_OK;
}
? ERROR_FAIL : ERROR_OK;
}
- for (const struct stlink_layout *l = stlink_layout_get_list(); l->name;
+ for (const struct hl_layout *l = hl_layout_get_list(); l->name;
l++) {
if (strcmp(l->name, CMD_ARGV[0]) == 0) {
l++) {
if (strcmp(l->name, CMD_ARGV[0]) == 0) {
- LOG_ERROR("No STLINK layout '%s' found", CMD_ARGV[0]);
+ LOG_ERROR("No adapter layout '%s' found", CMD_ARGV[0]);
-COMMAND_HANDLER(stlink_interface_handle_vid_pid_command)
+COMMAND_HANDLER(hl_interface_handle_vid_pid_command)
- LOG_DEBUG("stlink_interface_handle_vid_pid_command");
+ LOG_DEBUG("hl_interface_handle_vid_pid_command");
- LOG_WARNING
- ("ignoring extra IDs in stlink_vid_pid (maximum is 1 pair)");
+ LOG_WARNING("ignoring extra IDs in hl_vid_pid (maximum is 1 pair)");
return ERROR_COMMAND_SYNTAX_ERROR;
}
return ERROR_COMMAND_SYNTAX_ERROR;
}
- COMMAND_PARSE_NUMBER(u16, CMD_ARGV[0], stlink_if.param.vid);
- COMMAND_PARSE_NUMBER(u16, CMD_ARGV[1], stlink_if.param.pid);
+ COMMAND_PARSE_NUMBER(u16, CMD_ARGV[0], hl_if.param.vid);
+ COMMAND_PARSE_NUMBER(u16, CMD_ARGV[1], hl_if.param.pid);
-COMMAND_HANDLER(stlink_interface_handle_api_command)
+COMMAND_HANDLER(hl_interface_handle_api_command)
{
if (CMD_ARGC != 1)
return ERROR_COMMAND_SYNTAX_ERROR;
{
if (CMD_ARGC != 1)
return ERROR_COMMAND_SYNTAX_ERROR;
if ((new_api == 0) || (new_api > 2))
return ERROR_COMMAND_SYNTAX_ERROR;
if ((new_api == 0) || (new_api > 2))
return ERROR_COMMAND_SYNTAX_ERROR;
- stlink_if.param.api = new_api;
+ hl_if.param.api = new_api;
-static const struct command_registration stlink_interface_command_handlers[] = {
+static const struct command_registration hl_interface_command_handlers[] = {
{
.name = "stlink_device_desc",
{
.name = "stlink_device_desc",
- .handler = &stlink_interface_handle_device_desc_command,
+ .handler = &hl_interface_handle_device_desc_command,
- .help = "set the stlink device description of the STLINK device",
+ .help = "set the a device description of the adapter",
.usage = "description_string",
},
{
.name = "stlink_serial",
.usage = "description_string",
},
{
.name = "stlink_serial",
- .handler = &stlink_interface_handle_serial_command,
+ .handler = &hl_interface_handle_serial_command,
- .help = "set the serial number of the STLINK device",
+ .help = "set the serial number of the adapter",
.usage = "serial_string",
},
{
.name = "stlink_layout",
.usage = "serial_string",
},
{
.name = "stlink_layout",
- .handler = &stlink_interface_handle_layout_command,
+ .handler = &hl_interface_handle_layout_command,
- .help = "set the layout of the STLINK to usb or sg",
+ .help = "set the layout of the adapter",
.usage = "layout_name",
},
{
.name = "stlink_vid_pid",
.usage = "layout_name",
},
{
.name = "stlink_vid_pid",
- .handler = &stlink_interface_handle_vid_pid_command,
+ .handler = &hl_interface_handle_vid_pid_command,
- .help = "the vendor and product ID of the STLINK device",
+ .help = "the vendor and product ID of the adapter",
.usage = "(vid pid)* ",
},
{
.name = "stlink_api",
.usage = "(vid pid)* ",
},
{
.name = "stlink_api",
- .handler = &stlink_interface_handle_api_command,
+ .handler = &hl_interface_handle_api_command,
.mode = COMMAND_CONFIG,
.help = "set the desired stlink api level",
.usage = "api version 1 or 2",
.mode = COMMAND_CONFIG,
.help = "set the desired stlink api level",
.usage = "api version 1 or 2",
COMMAND_REGISTRATION_DONE
};
COMMAND_REGISTRATION_DONE
};
-struct jtag_interface stlink_interface = {
+struct jtag_interface hl_interface = {
.name = "stlink",
.supported = 0,
.name = "stlink",
.supported = 0,
- .commands = stlink_interface_command_handlers,
- .transports = stlink_transports,
- .init = stlink_interface_init,
- .quit = stlink_interface_quit,
- .speed = stlink_interface_speed,
- .speed_div = stlink_speed_div,
- .khz = stlink_khz,
- .execute_queue = stlink_interface_execute_queue,
+ .commands = hl_interface_command_handlers,
+ .transports = hl_transports,
+ .init = hl_interface_init,
+ .quit = hl_interface_quit,
+ .speed = hl_interface_speed,
+ .speed_div = hl_speed_div,
+ .khz = hl_khz,
+ .execute_queue = hl_interface_execute_queue,
* Copyright (C) 2011 by Mathias Kuester *
* Mathias Kuester <kesmtp@freenet.de> *
* *
* Copyright (C) 2011 by Mathias Kuester *
* Mathias Kuester <kesmtp@freenet.de> *
* *
+ * Copyright (C) 2012 by Spencer Oliver *
+ * spen@spen-soft.co.uk *
+ * *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
-#ifndef _STLINK_INTERFACE_
-#define _STLINK_INTERFACE_
+#ifndef _HL_INTERFACE
+#define _HL_INTERFACE
/** */
struct target;
/** */
/** */
struct target;
/** */
-enum e_stlink_transports;
-extern const char *stlink_transports[];
+extern const char *hl_transports[];
-struct stlink_interface_param_s {
+struct hl_interface_param_s {
/** */
char *device_desc;
/** */
/** */
char *device_desc;
/** */
/** */
unsigned api;
/** */
/** */
unsigned api;
/** */
- enum stlink_transports transport;
+ enum hl_transports transport;
-struct stlink_interface_s {
- struct stlink_interface_param_s param;
+ struct hl_interface_param_s param;
- const struct stlink_layout *layout;
+ const struct hl_layout *layout;
/** */
void *fd;
};
/** */
/** */
void *fd;
};
/** */
-int stlink_interface_open(enum stlink_transports tr);
+int hl_interface_open(enum hl_transports tr);
-int stlink_interface_init_target(struct target *t);
-int stlink_interface_init_reset(void);
+int hl_interface_init_target(struct target *t);
+int hl_interface_init_reset(void);
+
+#endif /* _HL_INTERFACE */
* Copyright (C) 2011 by Mathias Kuester *
* Mathias Kuester <kesmtp@freenet.de> *
* *
* Copyright (C) 2011 by Mathias Kuester *
* Mathias Kuester <kesmtp@freenet.de> *
* *
+ * Copyright (C) 2012 by Spencer Oliver *
+ * spen@spen-soft.co.uk *
+ * *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
#include <transport/transport.h>
#include <helper/time_support.h>
#include <transport/transport.h>
#include <helper/time_support.h>
-#include <jtag/stlink/stlink_layout.h>
-#include <jtag/stlink/stlink_tcl.h>
-#include <jtag/stlink/stlink_transport.h>
-#include <jtag/stlink/stlink_interface.h>
+#include <jtag/hla/hla_layout.h>
+#include <jtag/hla/hla_tcl.h>
+#include <jtag/hla/hla_transport.h>
+#include <jtag/hla/hla_interface.h>
-static int stlink_layout_open(struct stlink_interface_s *stlink_if)
+static int hl_layout_open(struct hl_interface_s *adapter)
- LOG_DEBUG("stlink_layout_open");
+ LOG_DEBUG("hl_layout_open");
- res = stlink_if->layout->api->open(&stlink_if->param, &stlink_if->fd);
+ res = adapter->layout->api->open(&adapter->param, &adapter->fd);
if (res != ERROR_OK) {
LOG_DEBUG("failed");
if (res != ERROR_OK) {
LOG_DEBUG("failed");
-static int stlink_layout_close(struct stlink_interface_s *stlink_if)
+static int hl_layout_close(struct hl_interface_s *adapter)
-static const struct stlink_layout stlink_layouts[] = {
+static const struct hl_layout hl_layouts[] = {
- .open = stlink_layout_open,
- .close = stlink_layout_close,
+ .open = hl_layout_open,
+ .close = hl_layout_close,
.api = &stlink_usb_layout_api,
},
{.name = NULL, /* END OF TABLE */ },
};
/** */
.api = &stlink_usb_layout_api,
},
{.name = NULL, /* END OF TABLE */ },
};
/** */
-const struct stlink_layout *stlink_layout_get_list(void)
+const struct hl_layout *hl_layout_get_list(void)
-int stlink_layout_init(struct stlink_interface_s *stlink_if)
+int hl_layout_init(struct hl_interface_s *adapter)
- LOG_DEBUG("stlink_layout_init");
+ LOG_DEBUG("hl_layout_init");
- if (stlink_if->layout == NULL) {
+ if (adapter->layout == NULL) {
LOG_ERROR("no layout specified");
return ERROR_FAIL;
}
LOG_ERROR("no layout specified");
return ERROR_FAIL;
}
* Copyright (C) 2011 by Mathias Kuester *
* Mathias Kuester <kesmtp@freenet.de> *
* *
* Copyright (C) 2011 by Mathias Kuester *
* Mathias Kuester <kesmtp@freenet.de> *
* *
+ * Copyright (C) 2012 by Spencer Oliver *
+ * spen@spen-soft.co.uk *
+ * *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
-#ifndef _STLINK_LAYOUT_H_
-#define _STLINK_LAYOUT_H_
+#ifndef _HL_LAYOUT_H
+#define _HL_LAYOUT_H
-struct stlink_interface_s;
-struct stlink_interface_param_s;
+struct hl_interface_s;
+struct hl_interface_param_s;
-extern struct stlink_layout_api_s stlink_usb_layout_api;
+extern struct hl_layout_api_s stlink_usb_layout_api;
-struct stlink_layout_api_s {
+struct hl_layout_api_s {
- int (*open) (struct stlink_interface_param_s *param, void **fd);
+ int (*open) (struct hl_interface_param_s *param, void **fd);
/** */
int (*close) (void *fd);
/** */
/** */
int (*close) (void *fd);
/** */
/** */
char *name;
/** */
/** */
char *name;
/** */
- int (*open) (struct stlink_interface_s *stlink_if);
+ int (*open) (struct hl_interface_s *adapter);
- int (*close) (struct stlink_interface_s *stlink_if);
+ int (*close) (struct hl_interface_s *adapter);
- struct stlink_layout_api_s *api;
+ struct hl_layout_api_s *api;
-const struct stlink_layout *stlink_layout_get_list(void);
+const struct hl_layout *hl_layout_get_list(void);
-int stlink_layout_init(struct stlink_interface_s *stlink_if);
+int hl_layout_init(struct hl_interface_s *adapter);
+#endif /* _HL_LAYOUT_H */
* Copyright (C) 2011 by Mathias Kuester *
* Mathias Kuester <kesmtp@freenet.de> *
* *
* Copyright (C) 2011 by Mathias Kuester *
* Mathias Kuester <kesmtp@freenet.de> *
* *
+ * Copyright (C) 2012 by Spencer Oliver *
+ * spen@spen-soft.co.uk *
+ * *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
#define NTAP_OPT_EXPECTED_ID 0
#define NTAP_OPT_EXPECTED_ID 0
-static int jim_stlink_newtap_cmd(Jim_GetOptInfo *goi)
+static int jim_hl_newtap_cmd(Jim_GetOptInfo *goi)
{
struct jtag_tap *pTap;
int x;
{
struct jtag_tap *pTap;
int x;
-int jim_stlink_newtap(Jim_Interp *interp, int argc, Jim_Obj * const *argv)
+int jim_hl_newtap(Jim_Interp *interp, int argc, Jim_Obj * const *argv)
{
Jim_GetOptInfo goi;
Jim_GetOpt_Setup(&goi, interp, argc - 1, argv + 1);
{
Jim_GetOptInfo goi;
Jim_GetOpt_Setup(&goi, interp, argc - 1, argv + 1);
- return jim_stlink_newtap_cmd(&goi);
+ return jim_hl_newtap_cmd(&goi);
* Copyright (C) 2011 by Mathias Kuester *
* Mathias Kuester <kesmtp@freenet.de> *
* *
* Copyright (C) 2011 by Mathias Kuester *
* Mathias Kuester <kesmtp@freenet.de> *
* *
+ * Copyright (C) 2012 by Spencer Oliver *
+ * spen@spen-soft.co.uk *
+ * *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
-#ifndef _STLINK_TCL_
-#define _STLINK_TCL_
+#ifndef _HL_TCL_
+#define _HL_TCL_
-int jim_stlink_newtap(Jim_Interp *interp, int argc, Jim_Obj * const *argv);
+int jim_hl_newtap(Jim_Interp *interp, int argc, Jim_Obj * const *argv);
* Copyright (C) 2011 by Mathias Kuester *
* Mathias Kuester <kesmtp@freenet.de> *
* *
* Copyright (C) 2011 by Mathias Kuester *
* Mathias Kuester <kesmtp@freenet.de> *
* *
+ * Copyright (C) 2012 by Spencer Oliver *
+ * spen@spen-soft.co.uk *
+ * *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
#include <transport/transport.h>
#include <helper/time_support.h>
#include <target/target.h>
#include <transport/transport.h>
#include <helper/time_support.h>
#include <target/target.h>
-#include <jtag/stlink/stlink_tcl.h>
-#include <jtag/stlink/stlink_transport.h>
-#include <jtag/stlink/stlink_interface.h>
+#include <jtag/hla/hla_tcl.h>
+#include <jtag/hla/hla_transport.h>
+#include <jtag/hla/hla_interface.h>
-COMMAND_HANDLER(stlink_transport_jtag_command)
+COMMAND_HANDLER(hl_transport_jtag_command)
- LOG_DEBUG("stlink_transport_jtag_command");
+ LOG_DEBUG("hl_transport_jtag_command");
-COMMAND_HANDLER(stlink_transport_reset_command)
+COMMAND_HANDLER(hl_transport_reset_command)
- return stlink_interface_init_reset();
+ return hl_interface_init_reset();
}
static const struct command_registration
}
static const struct command_registration
-stlink_transport_stlink_subcommand_handlers[] = {
+hl_transport_stlink_subcommand_handlers[] = {
{
.name = "newtap",
.mode = COMMAND_CONFIG,
{
.name = "newtap",
.mode = COMMAND_CONFIG,
- .jim_handler = jim_stlink_newtap,
+ .jim_handler = jim_hl_newtap,
.help = "Create a new TAP instance named basename.tap_type, "
"and appends it to the scan chain.",
.usage = "basename tap_type '-irlen' count "
.help = "Create a new TAP instance named basename.tap_type, "
"and appends it to the scan chain.",
.usage = "basename tap_type '-irlen' count "
};
static const struct command_registration
};
static const struct command_registration
-stlink_transport_jtag_subcommand_handlers[] = {
+hl_transport_jtag_subcommand_handlers[] = {
{
.name = "init",
.mode = COMMAND_ANY,
{
.name = "init",
.mode = COMMAND_ANY,
- .handler = stlink_transport_jtag_command,
+ .handler = hl_transport_jtag_command,
.usage = ""
},
{
.name = "arp_init",
.mode = COMMAND_ANY,
.usage = ""
},
{
.name = "arp_init",
.mode = COMMAND_ANY,
- .handler = stlink_transport_jtag_command,
+ .handler = hl_transport_jtag_command,
.usage = ""
},
{
.name = "arp_init-reset",
.mode = COMMAND_ANY,
.usage = ""
},
{
.name = "arp_init-reset",
.mode = COMMAND_ANY,
- .handler = stlink_transport_reset_command,
+ .handler = hl_transport_reset_command,
{
.name = "tapdisable",
.mode = COMMAND_EXEC,
{
.name = "tapdisable",
.mode = COMMAND_EXEC,
- .handler = stlink_transport_jtag_command,
+ .handler = hl_transport_jtag_command,
.usage = "",
},
{
.name = "configure",
.mode = COMMAND_EXEC,
.usage = "",
},
{
.name = "configure",
.mode = COMMAND_EXEC,
- .handler = stlink_transport_jtag_command,
+ .handler = hl_transport_jtag_command,
{
.name = "names",
.mode = COMMAND_ANY,
{
.name = "names",
.mode = COMMAND_ANY,
- .handler = stlink_transport_jtag_command,
+ .handler = hl_transport_jtag_command,
.mode = COMMAND_ANY,
.help = "perform stlink actions",
.usage = "",
.mode = COMMAND_ANY,
.help = "perform stlink actions",
.usage = "",
- .chain = stlink_transport_stlink_subcommand_handlers,
+ .chain = hl_transport_stlink_subcommand_handlers,
},
{
.name = "jtag",
.mode = COMMAND_ANY,
.usage = "",
},
{
.name = "jtag",
.mode = COMMAND_ANY,
.usage = "",
- .chain = stlink_transport_jtag_subcommand_handlers,
+ .chain = hl_transport_jtag_subcommand_handlers,
},
COMMAND_REGISTRATION_DONE
};
},
COMMAND_REGISTRATION_DONE
};
-static int stlink_transport_register_commands(struct command_context *cmd_ctx)
+static int hl_transport_register_commands(struct command_context *cmd_ctx)
{
return register_commands(cmd_ctx, NULL,
stlink_transport_command_handlers);
}
{
return register_commands(cmd_ctx, NULL,
stlink_transport_command_handlers);
}
-static int stlink_transport_init(struct command_context *cmd_ctx)
+static int hl_transport_init(struct command_context *cmd_ctx)
- LOG_DEBUG("stlink_transport_init");
+ LOG_DEBUG("hl_transport_init");
struct target *t = get_current_target(cmd_ctx);
struct transport *transport;
struct target *t = get_current_target(cmd_ctx);
struct transport *transport;
- enum stlink_transports tr;
if (!t) {
LOG_ERROR("no current target");
if (!t) {
LOG_ERROR("no current target");
LOG_DEBUG("current transport %s", transport->name);
/* get selected transport as enum */
LOG_DEBUG("current transport %s", transport->name);
/* get selected transport as enum */
- tr = STLINK_TRANSPORT_UNKNOWN;
+ tr = HL_TRANSPORT_UNKNOWN;
if (strcmp(transport->name, "stlink_swd") == 0)
if (strcmp(transport->name, "stlink_swd") == 0)
- tr = STLINK_TRANSPORT_SWD;
else if (strcmp(transport->name, "stlink_jtag") == 0)
else if (strcmp(transport->name, "stlink_jtag") == 0)
- tr = STLINK_TRANSPORT_JTAG;
+ tr = HL_TRANSPORT_JTAG;
else if (strcmp(transport->name, "stlink_swim") == 0)
else if (strcmp(transport->name, "stlink_swim") == 0)
- tr = STLINK_TRANSPORT_SWIM;
+ tr = HL_TRANSPORT_SWIM;
- int retval = stlink_interface_open(tr);
+ int retval = hl_interface_open(tr);
if (retval != ERROR_OK)
return retval;
if (retval != ERROR_OK)
return retval;
- return stlink_interface_init_target(t);
+ return hl_interface_init_target(t);
-static int stlink_transport_select(struct command_context *ctx)
+static int hl_transport_select(struct command_context *ctx)
- LOG_DEBUG("stlink_transport_select");
+ LOG_DEBUG("hl_transport_select");
* That works with only C code ... no Tcl glue required.
*/
* That works with only C code ... no Tcl glue required.
*/
- retval = stlink_transport_register_commands(ctx);
+ retval = hl_transport_register_commands(ctx);
if (retval != ERROR_OK)
return retval;
if (retval != ERROR_OK)
return retval;
-static struct transport stlink_swd_transport = {
+static struct transport hl_swd_transport = {
- .select = stlink_transport_select,
- .init = stlink_transport_init,
+ .select = hl_transport_select,
+ .init = hl_transport_init,
-static struct transport stlink_jtag_transport = {
+static struct transport hl_jtag_transport = {
- .select = stlink_transport_select,
- .init = stlink_transport_init,
+ .select = hl_transport_select,
+ .init = hl_transport_init,
-static struct transport stlink_swim_transport = {
+static struct transport hl_swim_transport = {
- .select = stlink_transport_select,
- .init = stlink_transport_init,
+ .select = hl_transport_select,
+ .init = hl_transport_init,
-const char *stlink_transports[] = { "stlink_swd", "stlink_jtag", "stlink_swim", NULL };
-
-static void stlink_constructor(void) __attribute__ ((constructor));
-static void stlink_constructor(void)
-{
- transport_register(&stlink_swd_transport);
- transport_register(&stlink_jtag_transport);
- transport_register(&stlink_swim_transport);
-}
+const char *hl_transports[] = { "stlink_swd", "stlink_jtag", "stlink_swim", NULL };
-bool transport_is_stlink(void)
+static void hl_constructor(void) __attribute__ ((constructor));
+static void hl_constructor(void)
- return get_current_transport() == &stlink_swd_transport;
+ transport_register(&hl_swd_transport);
+ transport_register(&hl_jtag_transport);
+ transport_register(&hl_swim_transport);
* Copyright (C) 2011 by Mathias Kuester *
* Mathias Kuester <kesmtp@freenet.de> *
* *
* Copyright (C) 2011 by Mathias Kuester *
* Mathias Kuester <kesmtp@freenet.de> *
* *
+ * Copyright (C) 2012 by Spencer Oliver *
+ * spen@spen-soft.co.uk *
+ * *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
-#ifndef _STLINK_TRANSPORT_
-#define _STLINK_TRANSPORT_
+#ifndef _HL_TRANSPORT
+#define _HL_TRANSPORT
-enum stlink_transports {
- STLINK_TRANSPORT_UNKNOWN = 0,
- STLINK_TRANSPORT_SWD,
- STLINK_TRANSPORT_JTAG,
- STLINK_TRANSPORT_SWIM
+enum hl_transports {
+ HL_TRANSPORT_UNKNOWN = 0,
+ HL_TRANSPORT_SWD,
+ HL_TRANSPORT_JTAG,
+ HL_TRANSPORT_SWIM
+#endif /* _HL_TRANSPORT */
#if BUILD_REMOTE_BITBANG == 1
extern struct jtag_interface remote_bitbang_interface;
#endif
#if BUILD_REMOTE_BITBANG == 1
extern struct jtag_interface remote_bitbang_interface;
#endif
-#if BUILD_STLINK == 1
-extern struct jtag_interface stlink_interface;
+#if BUILD_HLADAPTER == 1
+extern struct jtag_interface hl_interface;
#endif
#if BUILD_OSBDM == 1
extern struct jtag_interface osbdm_interface;
#endif
#if BUILD_OSBDM == 1
extern struct jtag_interface osbdm_interface;
#if BUILD_REMOTE_BITBANG == 1
&remote_bitbang_interface,
#endif
#if BUILD_REMOTE_BITBANG == 1
&remote_bitbang_interface,
#endif
-#if BUILD_STLINK == 1
- &stlink_interface,
+#if BUILD_HLADAPTER == 1
+ &hl_interface,
#endif
#if BUILD_OSBDM == 1
&osbdm_interface,
#endif
#if BUILD_OSBDM == 1
&osbdm_interface,
+++ /dev/null
-include $(top_srcdir)/common.mk
-
-noinst_LTLIBRARIES = libocdstlink.la
-
-libocdstlink_la_SOURCES = \
- $(STLINKFILES)
-
-STLINKFILES =
-
-if STLINK
-STLINKFILES += stlink_transport.c
-STLINKFILES += stlink_tcl.c
-STLINKFILES += stlink_interface.c
-STLINKFILES += stlink_layout.c
-endif
-
-noinst_HEADERS = \
- stlink_interface.h \
- stlink_layout.h \
- stlink_tcl.h \
- stlink_transport.h
-
-MAINTAINERCLEANFILES = $(srcdir)/Makefile.in
dsp563xx.c \
dsp563xx_once.c \
dsp5680xx.c \
dsp563xx.c \
dsp563xx_once.c \
dsp5680xx.c \
TARGET_CORE_SRC = \
algorithm.c \
TARGET_CORE_SRC = \
algorithm.c \
#endif
#include "jtag/jtag.h"
#endif
#include "jtag/jtag.h"
-#include "jtag/stlink/stlink_transport.h"
-#include "jtag/stlink/stlink_interface.h"
-#include "jtag/stlink/stlink_layout.h"
+#include "jtag/hla/hla_transport.h"
+#include "jtag/hla/hla_interface.h"
+#include "jtag/hla/hla_layout.h"
#include "register.h"
#include "algorithm.h"
#include "target.h"
#include "register.h"
#include "algorithm.h"
#include "target.h"
#define ARMV7M_SCS_DCRSR 0xe000edf4
#define ARMV7M_SCS_DCRDR 0xe000edf8
#define ARMV7M_SCS_DCRSR 0xe000edf4
#define ARMV7M_SCS_DCRDR 0xe000edf8
-static inline struct stlink_interface_s *target_to_stlink(struct target *target)
+static inline struct hl_interface_s *target_to_adapter(struct target *target)
{
return target->tap->priv;
}
{
return target->tap->priv;
}
-static int stm32_stlink_load_core_reg_u32(struct target *target,
+static int adapter_load_core_reg_u32(struct target *target,
enum armv7m_regtype type,
uint32_t num, uint32_t *value)
{
int retval;
enum armv7m_regtype type,
uint32_t num, uint32_t *value)
{
int retval;
- struct stlink_interface_s *stlink_if = target_to_stlink(target);
+ struct hl_interface_s *adapter = target_to_adapter(target);
LOG_DEBUG("%s", __func__);
LOG_DEBUG("%s", __func__);
switch (num) {
case 0 ... 18:
/* read a normal core register */
switch (num) {
case 0 ... 18:
/* read a normal core register */
- retval = stlink_if->layout->api->read_reg(stlink_if->fd, num, value);
+ retval = adapter->layout->api->read_reg(adapter->fd, num, value);
if (retval != ERROR_OK) {
LOG_ERROR("JTAG failure %i", retval);
if (retval != ERROR_OK) {
LOG_ERROR("JTAG failure %i", retval);
* in one Debug Core register. So say r0 and r2 docs;
* it was removed from r1 docs, but still works.
*/
* in one Debug Core register. So say r0 and r2 docs;
* it was removed from r1 docs, but still works.
*/
- retval = stlink_if->layout->api->read_reg(stlink_if->fd, 20, value);
+ retval = adapter->layout->api->read_reg(adapter->fd, 20, value);
if (retval != ERROR_OK)
return retval;
if (retval != ERROR_OK)
return retval;
-static int stm32_stlink_store_core_reg_u32(struct target *target,
+static int adapter_store_core_reg_u32(struct target *target,
enum armv7m_regtype type,
uint32_t num, uint32_t value)
{
int retval;
uint32_t reg;
struct armv7m_common *armv7m = target_to_armv7m(target);
enum armv7m_regtype type,
uint32_t num, uint32_t value)
{
int retval;
uint32_t reg;
struct armv7m_common *armv7m = target_to_armv7m(target);
- struct stlink_interface_s *stlink_if = target_to_stlink(target);
+ struct hl_interface_s *adapter = target_to_adapter(target);
LOG_DEBUG("%s", __func__);
LOG_DEBUG("%s", __func__);
*/
switch (num) {
case 0 ... 18:
*/
switch (num) {
case 0 ... 18:
- retval = stlink_if->layout->api->write_reg(stlink_if->fd, num, value);
+ retval = adapter->layout->api->write_reg(adapter->fd, num, value);
if (retval != ERROR_OK) {
struct reg *r;
if (retval != ERROR_OK) {
struct reg *r;
* it was removed from r1 docs, but still works.
*/
* it was removed from r1 docs, but still works.
*/
- stlink_if->layout->api->read_reg(stlink_if->fd, 20, ®);
+ adapter->layout->api->read_reg(adapter->fd, 20, ®);
switch (num) {
case ARMV7M_PRIMASK:
switch (num) {
case ARMV7M_PRIMASK:
- stlink_if->layout->api->write_reg(stlink_if->fd, 20, reg);
+ adapter->layout->api->write_reg(adapter->fd, 20, reg);
LOG_DEBUG("write special reg %i value 0x%" PRIx32 " ", (int)num, value);
break;
LOG_DEBUG("write special reg %i value 0x%" PRIx32 " ", (int)num, value);
break;
-static int stm32_stlink_examine_debug_reason(struct target *target)
+static int adapter_examine_debug_reason(struct target *target)
{
if ((target->debug_reason != DBG_REASON_DBGRQ)
&& (target->debug_reason != DBG_REASON_SINGLESTEP)) {
{
if ((target->debug_reason != DBG_REASON_DBGRQ)
&& (target->debug_reason != DBG_REASON_SINGLESTEP)) {
-static int stm32_stlink_init_arch_info(struct target *target,
+static int adapter_init_arch_info(struct target *target,
struct cortex_m3_common *cortex_m3,
struct jtag_tap *tap)
{
struct cortex_m3_common *cortex_m3,
struct jtag_tap *tap)
{
armv7m = &cortex_m3->armv7m;
armv7m_init_arch_info(target, armv7m);
armv7m = &cortex_m3->armv7m;
armv7m_init_arch_info(target, armv7m);
- armv7m->load_core_reg_u32 = stm32_stlink_load_core_reg_u32;
- armv7m->store_core_reg_u32 = stm32_stlink_store_core_reg_u32;
+ armv7m->load_core_reg_u32 = adapter_load_core_reg_u32;
+ armv7m->store_core_reg_u32 = adapter_store_core_reg_u32;
- armv7m->examine_debug_reason = stm32_stlink_examine_debug_reason;
+ armv7m->examine_debug_reason = adapter_examine_debug_reason;
armv7m->stlink = true;
return ERROR_OK;
}
armv7m->stlink = true;
return ERROR_OK;
}
-static int stm32_stlink_init_target(struct command_context *cmd_ctx,
+static int adapter_init_target(struct command_context *cmd_ctx,
struct target *target)
{
LOG_DEBUG("%s", __func__);
struct target *target)
{
LOG_DEBUG("%s", __func__);
-static int stm32_stlink_target_create(struct target *target,
+static int adapter_target_create(struct target *target,
Jim_Interp *interp)
{
LOG_DEBUG("%s", __func__);
Jim_Interp *interp)
{
LOG_DEBUG("%s", __func__);
if (!cortex_m3)
return ERROR_COMMAND_SYNTAX_ERROR;
if (!cortex_m3)
return ERROR_COMMAND_SYNTAX_ERROR;
- stm32_stlink_init_arch_info(target, cortex_m3, target->tap);
+ adapter_init_arch_info(target, cortex_m3, target->tap);
-static int stm32_stlink_load_context(struct target *target)
+static int adapter_load_context(struct target *target)
{
struct armv7m_common *armv7m = target_to_armv7m(target);
int num_regs = armv7m->core_cache->num_regs;
{
struct armv7m_common *armv7m = target_to_armv7m(target);
int num_regs = armv7m->core_cache->num_regs;
-static int stlink_debug_entry(struct target *target)
+static int adapter_debug_entry(struct target *target)
- struct stlink_interface_s *stlink_if = target_to_stlink(target);
+ struct hl_interface_s *adapter = target_to_adapter(target);
struct armv7m_common *armv7m = target_to_armv7m(target);
struct arm *arm = &armv7m->arm;
struct reg *r;
struct armv7m_common *armv7m = target_to_armv7m(target);
struct arm *arm = &armv7m->arm;
struct reg *r;
if (retval != ERROR_OK)
return retval;
if (retval != ERROR_OK)
return retval;
- stm32_stlink_load_context(target);
+ adapter_load_context(target);
/* make sure we clear the vector catch bit */
/* make sure we clear the vector catch bit */
- stlink_if->layout->api->write_debug_reg(stlink_if->fd, DCB_DEMCR, 0);
+ adapter->layout->api->write_debug_reg(adapter->fd, DCB_DEMCR, 0);
r = armv7m->core_cache->reg_list + ARMV7M_xPSR;
xPSR = buf_get_u32(r->value, 0, 32);
r = armv7m->core_cache->reg_list + ARMV7M_xPSR;
xPSR = buf_get_u32(r->value, 0, 32);
-static int stm32_stlink_poll(struct target *target)
+static int adapter_poll(struct target *target)
{
enum target_state state;
{
enum target_state state;
- struct stlink_interface_s *stlink_if = target_to_stlink(target);
+ struct hl_interface_s *adapter = target_to_adapter(target);
struct armv7m_common *armv7m = target_to_armv7m(target);
struct armv7m_common *armv7m = target_to_armv7m(target);
- state = stlink_if->layout->api->state(stlink_if->fd);
+ state = adapter->layout->api->state(adapter->fd);
if (state == TARGET_UNKNOWN) {
LOG_ERROR("jtag status contains invalid mode value - communication failure");
if (state == TARGET_UNKNOWN) {
LOG_ERROR("jtag status contains invalid mode value - communication failure");
if (state == TARGET_HALTED) {
target->state = state;
if (state == TARGET_HALTED) {
target->state = state;
- int retval = stlink_debug_entry(target);
+ int retval = adapter_debug_entry(target);
if (retval != ERROR_OK)
return retval;
if (retval != ERROR_OK)
return retval;
-static int stm32_stlink_assert_reset(struct target *target)
+static int adapter_assert_reset(struct target *target)
- struct stlink_interface_s *stlink_if = target_to_stlink(target);
+ struct hl_interface_s *adapter = target_to_adapter(target);
struct armv7m_common *armv7m = target_to_armv7m(target);
bool use_srst_fallback = true;
struct armv7m_common *armv7m = target_to_armv7m(target);
bool use_srst_fallback = true;
if (jtag_reset_config & RESET_SRST_NO_GATING) {
jtag_add_reset(0, 1);
if (jtag_reset_config & RESET_SRST_NO_GATING) {
jtag_add_reset(0, 1);
- res = stlink_if->layout->api->assert_srst(stlink_if->fd, 0);
+ res = adapter->layout->api->assert_srst(adapter->fd, 0);
- stlink_if->layout->api->write_debug_reg(stlink_if->fd, DCB_DHCSR, DBGKEY|C_DEBUGEN);
+ adapter->layout->api->write_debug_reg(adapter->fd, DCB_DHCSR, DBGKEY|C_DEBUGEN);
/* only set vector catch if halt is requested */
if (target->reset_halt)
/* only set vector catch if halt is requested */
if (target->reset_halt)
- stlink_if->layout->api->write_debug_reg(stlink_if->fd, DCB_DEMCR, VC_CORERESET);
+ adapter->layout->api->write_debug_reg(adapter->fd, DCB_DEMCR, VC_CORERESET);
- stlink_if->layout->api->write_debug_reg(stlink_if->fd, DCB_DEMCR, 0);
+ adapter->layout->api->write_debug_reg(adapter->fd, DCB_DEMCR, 0);
if (jtag_reset_config & RESET_HAS_SRST) {
if (!srst_asserted) {
jtag_add_reset(0, 1);
if (jtag_reset_config & RESET_HAS_SRST) {
if (!srst_asserted) {
jtag_add_reset(0, 1);
- res = stlink_if->layout->api->assert_srst(stlink_if->fd, 0);
+ res = adapter->layout->api->assert_srst(adapter->fd, 0);
}
if (res == ERROR_COMMAND_NOTFOUND)
LOG_ERROR("Hardware srst not supported, falling back to software reset");
}
if (res == ERROR_COMMAND_NOTFOUND)
LOG_ERROR("Hardware srst not supported, falling back to software reset");
if (use_srst_fallback) {
/* stlink v1 api does not support hardware srst, so we use a software reset fallback */
if (use_srst_fallback) {
/* stlink v1 api does not support hardware srst, so we use a software reset fallback */
- stlink_if->layout->api->write_debug_reg(stlink_if->fd, NVIC_AIRCR, AIRCR_VECTKEY | AIRCR_SYSRESETREQ);
+ adapter->layout->api->write_debug_reg(adapter->fd, NVIC_AIRCR, AIRCR_VECTKEY | AIRCR_SYSRESETREQ);
- res = stlink_if->layout->api->reset(stlink_if->fd);
+ res = adapter->layout->api->reset(adapter->fd);
if (res != ERROR_OK)
return res;
if (res != ERROR_OK)
return res;
-static int stm32_stlink_deassert_reset(struct target *target)
+static int adapter_deassert_reset(struct target *target)
- struct stlink_interface_s *stlink_if = target_to_stlink(target);
+ struct hl_interface_s *adapter = target_to_adapter(target);
enum reset_types jtag_reset_config = jtag_get_reset_config();
LOG_DEBUG("%s", __func__);
if (jtag_reset_config & RESET_HAS_SRST)
enum reset_types jtag_reset_config = jtag_get_reset_config();
LOG_DEBUG("%s", __func__);
if (jtag_reset_config & RESET_HAS_SRST)
- stlink_if->layout->api->assert_srst(stlink_if->fd, 1);
+ adapter->layout->api->assert_srst(adapter->fd, 1);
/* virtual deassert reset, we need it for the internal
* jtag state machine
/* virtual deassert reset, we need it for the internal
* jtag state machine
-static int stm32_stlink_soft_reset_halt(struct target *target)
+static int adapter_soft_reset_halt(struct target *target)
{
LOG_DEBUG("%s", __func__);
return ERROR_OK;
}
{
LOG_DEBUG("%s", __func__);
return ERROR_OK;
}
-static int stm32_stlink_halt(struct target *target)
+static int adapter_halt(struct target *target)
- struct stlink_interface_s *stlink_if = target_to_stlink(target);
+ struct hl_interface_s *adapter = target_to_adapter(target);
LOG_DEBUG("%s", __func__);
LOG_DEBUG("%s", __func__);
if (target->state == TARGET_UNKNOWN)
LOG_WARNING("target was in unknown state when halt was requested");
if (target->state == TARGET_UNKNOWN)
LOG_WARNING("target was in unknown state when halt was requested");
- res = stlink_if->layout->api->halt(stlink_if->fd);
+ res = adapter->layout->api->halt(adapter->fd);
if (res != ERROR_OK)
return res;
if (res != ERROR_OK)
return res;
-static int stm32_stlink_resume(struct target *target, int current,
+static int adapter_resume(struct target *target, int current,
uint32_t address, int handle_breakpoints,
int debug_execution)
{
int res;
uint32_t address, int handle_breakpoints,
int debug_execution)
{
int res;
- struct stlink_interface_s *stlink_if = target_to_stlink(target);
+ struct hl_interface_s *adapter = target_to_adapter(target);
struct armv7m_common *armv7m = target_to_armv7m(target);
uint32_t resume_pc;
struct breakpoint *breakpoint = NULL;
struct armv7m_common *armv7m = target_to_armv7m(target);
uint32_t resume_pc;
struct breakpoint *breakpoint = NULL;
breakpoint->unique_id);
cortex_m3_unset_breakpoint(target, breakpoint);
breakpoint->unique_id);
cortex_m3_unset_breakpoint(target, breakpoint);
- res = stlink_if->layout->api->step(stlink_if->fd);
+ res = adapter->layout->api->step(adapter->fd);
if (res != ERROR_OK)
return res;
if (res != ERROR_OK)
return res;
- res = stlink_if->layout->api->run(stlink_if->fd);
+ res = adapter->layout->api->run(adapter->fd);
if (res != ERROR_OK)
return res;
if (res != ERROR_OK)
return res;
-static int stm32_stlink_step(struct target *target, int current,
+static int adapter_step(struct target *target, int current,
uint32_t address, int handle_breakpoints)
{
int res;
uint32_t address, int handle_breakpoints)
{
int res;
- struct stlink_interface_s *stlink_if = target_to_stlink(target);
+ struct hl_interface_s *adapter = target_to_adapter(target);
struct armv7m_common *armv7m = target_to_armv7m(target);
struct breakpoint *breakpoint = NULL;
struct reg *pc = armv7m->arm.pc;
struct armv7m_common *armv7m = target_to_armv7m(target);
struct breakpoint *breakpoint = NULL;
struct reg *pc = armv7m->arm.pc;
target_call_event_callbacks(target, TARGET_EVENT_RESUMED);
target_call_event_callbacks(target, TARGET_EVENT_RESUMED);
- res = stlink_if->layout->api->step(stlink_if->fd);
+ res = adapter->layout->api->step(adapter->fd);
if (res != ERROR_OK)
return res;
if (res != ERROR_OK)
return res;
if (breakpoint)
cortex_m3_set_breakpoint(target, breakpoint);
if (breakpoint)
cortex_m3_set_breakpoint(target, breakpoint);
- stlink_debug_entry(target);
+ adapter_debug_entry(target);
target_call_event_callbacks(target, TARGET_EVENT_HALTED);
LOG_INFO("halted: PC: 0x%08x", buf_get_u32(armv7m->arm.pc->value, 0, 32));
target_call_event_callbacks(target, TARGET_EVENT_HALTED);
LOG_INFO("halted: PC: 0x%08x", buf_get_u32(armv7m->arm.pc->value, 0, 32));
-static int stm32_stlink_read_memory(struct target *target, uint32_t address,
+static int adapter_read_memory(struct target *target, uint32_t address,
uint32_t size, uint32_t count,
uint8_t *buffer)
{
uint32_t size, uint32_t count,
uint8_t *buffer)
{
uint32_t buffer_threshold = 128;
uint32_t addr_increment = 4;
uint32_t c;
uint32_t buffer_threshold = 128;
uint32_t addr_increment = 4;
uint32_t c;
- struct stlink_interface_s *stlink_if = target_to_stlink(target);
+ struct hl_interface_s *adapter = target_to_adapter(target);
if (!count || !buffer)
return ERROR_COMMAND_SYNTAX_ERROR;
if (!count || !buffer)
return ERROR_COMMAND_SYNTAX_ERROR;
c = count;
if (size != 4)
c = count;
if (size != 4)
- res = stlink_if->layout->api->read_mem8(stlink_if->fd,
+ res = adapter->layout->api->read_mem8(adapter->fd,
address, c, buffer);
else
address, c, buffer);
else
- res = stlink_if->layout->api->read_mem32(stlink_if->fd,
+ res = adapter->layout->api->read_mem32(adapter->fd,
address, c, buffer);
if (res != ERROR_OK)
address, c, buffer);
if (res != ERROR_OK)
-static int stm32_stlink_write_memory(struct target *target, uint32_t address,
+static int adapter_write_memory(struct target *target, uint32_t address,
uint32_t size, uint32_t count,
const uint8_t *buffer)
{
uint32_t size, uint32_t count,
const uint8_t *buffer)
{
uint32_t buffer_threshold = 128;
uint32_t addr_increment = 4;
uint32_t c;
uint32_t buffer_threshold = 128;
uint32_t addr_increment = 4;
uint32_t c;
- struct stlink_interface_s *stlink_if = target_to_stlink(target);
+ struct hl_interface_s *adapter = target_to_adapter(target);
if (!count || !buffer)
return ERROR_COMMAND_SYNTAX_ERROR;
if (!count || !buffer)
return ERROR_COMMAND_SYNTAX_ERROR;
c = count;
if (size != 4)
c = count;
if (size != 4)
- res = stlink_if->layout->api->write_mem8(stlink_if->fd,
+ res = adapter->layout->api->write_mem8(adapter->fd,
address, c, buffer);
else
address, c, buffer);
else
- res = stlink_if->layout->api->write_mem32(stlink_if->fd,
+ res = adapter->layout->api->write_mem32(adapter->fd,
address, c, buffer);
if (res != ERROR_OK)
address, c, buffer);
if (res != ERROR_OK)
-static int stm32_stlink_bulk_write_memory(struct target *target,
+static int adapter_bulk_write_memory(struct target *target,
uint32_t address, uint32_t count,
const uint8_t *buffer)
{
uint32_t address, uint32_t count,
const uint8_t *buffer)
{
- return stm32_stlink_write_memory(target, address, 4, count, buffer);
+ return adapter_write_memory(target, address, 4, count, buffer);
-static const struct command_registration stm32_stlink_command_handlers[] = {
+static const struct command_registration adapter_command_handlers[] = {
{
.chain = arm_command_handlers,
},
{
.chain = arm_command_handlers,
},
struct target_type stm32_stlink_target = {
.name = "stm32_stlink",
struct target_type stm32_stlink_target = {
.name = "stm32_stlink",
- .init_target = stm32_stlink_init_target,
- .target_create = stm32_stlink_target_create,
+ .init_target = adapter_init_target,
+ .target_create = adapter_target_create,
.examine = cortex_m3_examine,
.examine = cortex_m3_examine,
- .commands = stm32_stlink_command_handlers,
+ .commands = adapter_command_handlers,
- .poll = stm32_stlink_poll,
.arch_state = armv7m_arch_state,
.arch_state = armv7m_arch_state,
- .assert_reset = stm32_stlink_assert_reset,
- .deassert_reset = stm32_stlink_deassert_reset,
- .soft_reset_halt = stm32_stlink_soft_reset_halt,
+ .assert_reset = adapter_assert_reset,
+ .deassert_reset = adapter_deassert_reset,
+ .soft_reset_halt = adapter_soft_reset_halt,
- .halt = stm32_stlink_halt,
- .resume = stm32_stlink_resume,
- .step = stm32_stlink_step,
+ .halt = adapter_halt,
+ .resume = adapter_resume,
+ .step = adapter_step,
.get_gdb_reg_list = armv7m_get_gdb_reg_list,
.get_gdb_reg_list = armv7m_get_gdb_reg_list,
- .read_memory = stm32_stlink_read_memory,
- .write_memory = stm32_stlink_write_memory,
- .bulk_write_memory = stm32_stlink_bulk_write_memory,
+ .read_memory = adapter_read_memory,
+ .write_memory = adapter_write_memory,
+ .bulk_write_memory = adapter_bulk_write_memory,
.checksum_memory = armv7m_checksum_memory,
.blank_check_memory = armv7m_blank_check_memory,
.checksum_memory = armv7m_checksum_memory,
.blank_check_memory = armv7m_blank_check_memory,
+
+ /* check for deprecated name */
+ if (target_types[x]->deprecated_name) {
+ if (0 == strcmp(cp, target_types[x]->deprecated_name)) {
+ /* found */
+ LOG_WARNING("target name is deprecated use: \'%s\'", target_types[x]->name);
+ break;
+ }
+ }
}
if (target_types[x] == NULL) {
Jim_SetResultFormatted(goi->interp, "Unknown target type %s, try one of ", cp);
}
if (target_types[x] == NULL) {
Jim_SetResultFormatted(goi->interp, "Unknown target type %s, try one of ", cp);
* field directly, use target_type_name() instead.
*/
const char *name;
* field directly, use target_type_name() instead.
*/
const char *name;
+ const char *deprecated_name;
/* poll current target status */
int (*poll)(struct target *target);
/* poll current target status */
int (*poll)(struct target *target);
Linking to existing account procedure
If you already have an account and want to add another login method
you
MUST first sign in with your existing account and
then change URL to read
https://review.openocd.org/login/?link
to get to this page again but this time it'll work for linking. Thank you.
SSH host keys fingerprints
1024 SHA256:YKx8b7u5ZWdcbp7/4AeXNaqElP49m6QrwfXaqQGJAOk gerrit-code-review@openocd.zylin.com (DSA)
384 SHA256:jHIbSQa4REvwCFG4cq5LBlBLxmxSqelQPem/EXIrxjk gerrit-code-review@openocd.org (ECDSA)
521 SHA256:UAOPYkU9Fjtcao0Ul/Rrlnj/OsQvt+pgdYSZ4jOYdgs gerrit-code-review@openocd.org (ECDSA)
256 SHA256:A13M5QlnozFOvTllybRZH6vm7iSt0XLxbA48yfc2yfY gerrit-code-review@openocd.org (ECDSA)
256 SHA256:spYMBqEYoAOtK7yZBrcwE8ZpYt6b68Cfh9yEVetvbXg gerrit-code-review@openocd.org (ED25519)
+--[ED25519 256]--+
|=.. |
|+o.. . |
|*.o . . |
|+B . . . |
|Bo. = o S |
|Oo.+ + = |
|oB=.* = . o |
| =+=.+ + E |
|. .=o . o |
+----[SHA256]-----+
2048 SHA256:0Onrb7/PHjpo6iVZ7xQX2riKN83FJ3KGU0TvI0TaFG4 gerrit-code-review@openocd.zylin.com (RSA)