cmsis-dap: add initial cmsis-dap support
This is based on work from: https://github.com/TheShed/OpenOCD-CMSIS-DAP/tree/cmsis-dap Main changes include moving over to using HIDAPI rather than libusb-1.0 and cleaning up to merge into master. Support for reset using srst has also been added. It has been tested on all the mbed boards as well as the Freedom board from Freescale. These boards only implement SWD mode, however JTAG mode has been tested with a Keil ULINK2 and a stm32 target - but requires a lot more work. Change-Id: I96d5ee1993bc9c0526219ab754c5aad3b55d812d Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Signed-off-by: Andrey Yurovsky <yurovsky@gmail.com> Reviewed-on: http://openocd.zylin.com/1542 Tested-by: jenkins
This commit is contained in:
20
configure.ac
20
configure.ac
@@ -209,6 +209,9 @@ m4_define([USB0_ADAPTERS],
|
||||
[[rlink], [Raisonance RLink JTAG Programmer], [RLINK]],
|
||||
[[armjtagew], [Olimex ARM-JTAG-EW Programmer], [ARMJTAGEW]]])
|
||||
|
||||
m4_define([HIDAPI_ADAPTERS],
|
||||
[[[cmsis_dap], [CMSIS-DAP Compliant Debugger], [CMSIS_DAP]]])
|
||||
|
||||
#========================================
|
||||
# FTD2XXX support comes in 4 forms.
|
||||
# (1) win32 - via a zip file
|
||||
@@ -367,7 +370,7 @@ m4_define([AC_ARG_ADAPTERS], [
|
||||
])
|
||||
])
|
||||
|
||||
AC_ARG_ADAPTERS([USB1_ADAPTERS, USB_ADAPTERS, USB0_ADAPTERS], [auto])
|
||||
AC_ARG_ADAPTERS([USB1_ADAPTERS, USB_ADAPTERS, USB0_ADAPTERS, HIDAPI_ADAPTERS], [auto])
|
||||
|
||||
AC_ARG_ENABLE([parport],
|
||||
AS_HELP_STRING([--enable-parport], [Enable building the pc parallel port driver]),
|
||||
@@ -751,7 +754,7 @@ else
|
||||
AC_DEFINE([BUILD_BUSPIRATE], [0], [0 if you don't want the Buspirate JTAG driver.])
|
||||
fi
|
||||
|
||||
if test "$use_internal_jimtcl" = yes; then
|
||||
if test $use_internal_jimtcl = yes; then
|
||||
if test -f "$srcdir/jimtcl/configure.ac"; then
|
||||
AX_CONFIG_SUBDIR_OPTION([jimtcl], [--disable-install-jim])
|
||||
else
|
||||
@@ -1103,6 +1106,15 @@ PKG_CHECK_MODULES([LIBUSB1], [libusb-1.0], [
|
||||
|
||||
PKG_CHECK_MODULES([LIBUSB0], [libusb], [use_libusb0=yes], [use_libusb0=no])
|
||||
|
||||
for hidapi_lib in hidapi hidapi-hidraw hidapi-libusb; do
|
||||
PKG_CHECK_MODULES([HIDAPI],[$hidapi_lib],[
|
||||
use_hidapi=yes
|
||||
break
|
||||
],[
|
||||
use_hidapi=no
|
||||
])
|
||||
done
|
||||
|
||||
m4_define([PROCESS_ADAPTERS], [
|
||||
m4_foreach([adapter], [$1], [
|
||||
if test $2; then
|
||||
@@ -1124,6 +1136,7 @@ m4_define([PROCESS_ADAPTERS], [
|
||||
PROCESS_ADAPTERS([USB1_ADAPTERS], [$use_libusb1 = yes], [libusb-1.x])
|
||||
PROCESS_ADAPTERS([USB_ADAPTERS], [$use_libusb1 = yes -o $use_libusb0 = yes], [libusb-1.x or libusb-0.1])
|
||||
PROCESS_ADAPTERS([USB0_ADAPTERS], [$use_libusb0 = yes], [libusb-0.1])
|
||||
PROCESS_ADAPTERS([HIDAPI_ADAPTERS], [$use_hidapi = yes], [hidapi])
|
||||
|
||||
if test $enable_stlink != no -o $enable_ti_icdi != no; then
|
||||
AC_DEFINE([BUILD_HLADAPTER], [1], [1 if you want the High Level JTAG driver.])
|
||||
@@ -1165,6 +1178,7 @@ AM_CONDITIONAL([IS_MINGW], [test $is_mingw = yes])
|
||||
AM_CONDITIONAL([IS_WIN32], [test $is_win32 = yes])
|
||||
AM_CONDITIONAL([IS_DARWIN], [test $is_darwin = yes])
|
||||
AM_CONDITIONAL([BITQ], [test $build_bitq = yes])
|
||||
AM_CONDITIONAL([CMSIS_DAP], [test $use_hidapi = yes])
|
||||
|
||||
AM_CONDITIONAL([MINIDRIVER], [test $build_minidriver = yes])
|
||||
AM_CONDITIONAL([MINIDRIVER_DUMMY], [test $build_minidriver_dummy = yes])
|
||||
@@ -1290,7 +1304,7 @@ echo
|
||||
echo
|
||||
echo OpenOCD configuration summary
|
||||
echo --------------------------------------------------
|
||||
m4_foreach([adapter], [USB1_ADAPTERS, USB_ADAPTERS, USB0_ADAPTERS],
|
||||
m4_foreach([adapter], [USB1_ADAPTERS, USB_ADAPTERS, USB0_ADAPTERS, HIDAPI_ADAPTERS],
|
||||
[echo -n m4_format(["%-40s"], ADAPTER_DESC([adapter]))
|
||||
case $ADAPTER_VAR([adapter]) in
|
||||
auto)
|
||||
|
||||
Reference in New Issue
Block a user