Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] openocd CMSIS-DAP support
@ 2019-01-07 17:12 mattwood2000 at gmail.com
  2019-01-10  5:56 ` Baruch Siach
  2019-02-06 10:59 ` Thomas Petazzoni
  0 siblings, 2 replies; 3+ messages in thread
From: mattwood2000 at gmail.com @ 2019-01-07 17:12 UTC (permalink / raw)
  To: buildroot

Hi,

I need CMSIS-DAP support in openOCD on my target build.  I noticed the
comment in openocd.mk explaining that CMSIS-DAP support is disabled for the
host build because HIDAPI is not supported in buildroot.

However, I see cmsis-dap support in the target options of openocd as well
as HIDAPI support for target buids.

I was able to add cmsis-dap support for the target easily with the patch
below.

Is there a reason why the CMSIS-DAP Adapter option in Config.in was removed
or never added for the target build?  If not I'll submit this but wanted to
make sure I wasn't missing something.

Thanks, Matt.

diff --git a/package/openocd/Config.in b/package/openocd/Config.in
index 6cba7a04c8..2145ac72eb 100644
--- a/package/openocd/Config.in
+++ b/package/openocd/Config.in
@@ -9,6 +9,16 @@ if BR2_PACKAGE_OPENOCD

 comment "Adapters"

+config BR2_PACKAGE_OPENOCD_CMSIS_DAP
+
+       bool "CMSIS-DAP compliant debuggers"
+       depends on BR2_TOOLCHAIN_HAS_THREADS # libusb
+       select BR2_PACKAGE_LIBUSB
+       select BR2_PACKAGE_HIDAPI
+       help
+         Enable support for CMSIS-DAP compliant
+         debuggers (i.e Atmel/Microchip EDBG, etc.)
+
 config BR2_PACKAGE_OPENOCD_FTDI
        bool "MPSSE mode of FTDI based devices"
        depends on BR2_TOOLCHAIN_HAS_THREADS # libusb
diff --git a/package/openocd/openocd.mk b/package/openocd/openocd.mk
index 9d2576ceeb..a4e7a26921 100644
--- a/package/openocd/openocd.mk
+++ b/package/openocd/openocd.mk
@@ -29,7 +29,8 @@ OPENOCD_DEPENDENCIES = \
        $(if $(BR2_PACKAGE_LIBFTDI1),libftdi1) \
        $(if $(BR2_PACKAGE_LIBUSB),libusb) \
        $(if $(BR2_PACKAGE_LIBUSB_COMPAT),libusb-compat) \
-       $(if $(BR2_PACKAGE_LIBHID),libhid)
+       $(if $(BR2_PACKAGE_LIBHID),libhid) \
+       $(if $(BR2_PACKAGE_HIDAPI),hidapi)

 # Adapters
 OPENOCD_CONF_OPTS += \
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20190107/503765d2/attachment.html>

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [Buildroot] openocd CMSIS-DAP support
  2019-01-07 17:12 [Buildroot] openocd CMSIS-DAP support mattwood2000 at gmail.com
@ 2019-01-10  5:56 ` Baruch Siach
  2019-02-06 10:59 ` Thomas Petazzoni
  1 sibling, 0 replies; 3+ messages in thread
From: Baruch Siach @ 2019-01-10  5:56 UTC (permalink / raw)
  To: buildroot

Hi Matt,

On Mon, Jan 07 2019, mattwood wrote:
> I need CMSIS-DAP support in openOCD on my target build.  I noticed the
> comment in openocd.mk explaining that CMSIS-DAP support is disabled for the
> host build because HIDAPI is not supported in buildroot.
>
> However, I see cmsis-dap support in the target options of openocd as well
> as HIDAPI support for target buids.
>
> I was able to add cmsis-dap support for the target easily with the patch
> below.
>
> Is there a reason why the CMSIS-DAP Adapter option in Config.in was removed
> or never added for the target build?  If not I'll submit this but wanted to
> make sure I wasn't missing something.

This patch looks correct to me.

Confusingly, commit aa441aa84c38 notes that CMSIS_DAP requires hidapi
which was not packaged in Buildroot at the time (Dec 2014). Still that
commit added a dangling --enable-cmsis-dap that could never be enabled
because BR2_PACKAGE_OPENOCD_CMSIS_DAP is not defined. Your patch fixes
that.

One more comment below.

> diff --git a/package/openocd/Config.in b/package/openocd/Config.in
> index 6cba7a04c8..2145ac72eb 100644
> --- a/package/openocd/Config.in
> +++ b/package/openocd/Config.in
> @@ -9,6 +9,16 @@ if BR2_PACKAGE_OPENOCD
>
>  comment "Adapters"
>
> +config BR2_PACKAGE_OPENOCD_CMSIS_DAP
> +
> +       bool "CMSIS-DAP compliant debuggers"
> +       depends on BR2_TOOLCHAIN_HAS_THREADS # libusb
> +       select BR2_PACKAGE_LIBUSB
> +       select BR2_PACKAGE_HIDAPI

You forgot the BR2_PACKAGE_HIDAPI dependencies:

	depends on BR2_PACKAGE_HAS_UDEV
	depends on BR2_TOOLCHAIN_HAS_THREADS_NPTL

Actually the NPTL dependency is stronger than plain threads
dependency. So you can drop the latter.

baruch

> +       help
> +         Enable support for CMSIS-DAP compliant
> +         debuggers (i.e Atmel/Microchip EDBG, etc.)
> +
>  config BR2_PACKAGE_OPENOCD_FTDI
>         bool "MPSSE mode of FTDI based devices"
>         depends on BR2_TOOLCHAIN_HAS_THREADS # libusb
> diff --git a/package/openocd/openocd.mk b/package/openocd/openocd.mk
> index 9d2576ceeb..a4e7a26921 100644
> --- a/package/openocd/openocd.mk
> +++ b/package/openocd/openocd.mk
> @@ -29,7 +29,8 @@ OPENOCD_DEPENDENCIES = \
>         $(if $(BR2_PACKAGE_LIBFTDI1),libftdi1) \
>         $(if $(BR2_PACKAGE_LIBUSB),libusb) \
>         $(if $(BR2_PACKAGE_LIBUSB_COMPAT),libusb-compat) \
> -       $(if $(BR2_PACKAGE_LIBHID),libhid)
> +       $(if $(BR2_PACKAGE_LIBHID),libhid) \
> +       $(if $(BR2_PACKAGE_HIDAPI),hidapi)
>
>  # Adapters
>  OPENOCD_CONF_OPTS += \

--
     http://baruch.siach.name/blog/                  ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - baruch at tkos.co.il - tel: +972.52.368.4656, http://www.tkos.co.il -

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Buildroot] openocd CMSIS-DAP support
  2019-01-07 17:12 [Buildroot] openocd CMSIS-DAP support mattwood2000 at gmail.com
  2019-01-10  5:56 ` Baruch Siach
@ 2019-02-06 10:59 ` Thomas Petazzoni
  1 sibling, 0 replies; 3+ messages in thread
From: Thomas Petazzoni @ 2019-02-06 10:59 UTC (permalink / raw)
  To: buildroot

Hello Matt,

On Mon, 7 Jan 2019 12:12:19 -0500
mattwood2000 at gmail.com wrote:

> Hi,
> 
> I need CMSIS-DAP support in openOCD on my target build.  I noticed the
> comment in openocd.mk explaining that CMSIS-DAP support is disabled for the
> host build because HIDAPI is not supported in buildroot.
> 
> However, I see cmsis-dap support in the target options of openocd as well
> as HIDAPI support for target buids.
> 
> I was able to add cmsis-dap support for the target easily with the patch
> below.
> 
> Is there a reason why the CMSIS-DAP Adapter option in Config.in was removed
> or never added for the target build?  If not I'll submit this but wanted to
> make sure I wasn't missing something.
> 
> Thanks, Matt.
> 
> diff --git a/package/openocd/Config.in b/package/openocd/Config.in
> index 6cba7a04c8..2145ac72eb 100644
> --- a/package/openocd/Config.in
> +++ b/package/openocd/Config.in
> @@ -9,6 +9,16 @@ if BR2_PACKAGE_OPENOCD

Applied to master after adding the missing "depends on" as pointed by
Arnout, and after reworking the commit log. Thanks!

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-02-06 10:59 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-01-07 17:12 [Buildroot] openocd CMSIS-DAP support mattwood2000 at gmail.com
2019-01-10  5:56 ` Baruch Siach
2019-02-06 10:59 ` Thomas Petazzoni

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox