Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 472622 - dev-embedded/openocd-0.7.0 USE=ftdi - openocd -c "interface list" does not list FTDI support
Summary: dev-embedded/openocd-0.7.0 USE=ftdi - openocd -c "interface list" does not li...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Development (show other bugs)
Hardware: AMD64 Linux
: Normal normal (vote)
Assignee: Embedded Team (OBSOLETE)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-06-07 21:13 UTC by David Relson
Modified: 2013-06-11 20:37 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
output of emerge --info (emerge-info.txt,6.07 KB, text/plain)
2013-06-07 21:14 UTC, David Relson
Details
output of emerge -pqv (emerge-pqv.txt,259 bytes, text/plain)
2013-06-07 21:14 UTC, David Relson
Details
build log (dev-embedded:openocd-0.7.0:20130607-205519.log,247.97 KB, text/x-log)
2013-06-07 21:15 UTC, David Relson
Details

Note You need to log in before you can comment on or make changes to this bug.
Description David Relson 2013-06-07 21:13:07 UTC
Hello,

I'm attempting to use emerge to build openocd-0.7.0 so that it is configured for the ftdi interface.  Specifying ftdi as the use flag, produces an executable that supports fd2232, which is an older, less reliable interface.

Build logs are attached.

Thank you.

Reproducible: Always

Steps to Reproduce:
1. echo dev-embedded/openocd ftdi -ftd2xx > /etc/portage/package.use/openocd
2. emerge openocd
3. openocd -c "interface list"
Actual Results:  
Running command:

   openocd -c "interface list"

produces:

    Open On-Chip Debugger 0.7.0 (2013-06-07-16:57)
    Licensed under GNU GPL v2
    For bug reports, read
	    http://openocd.sourceforge.net/doc/doxygen/bugs.html
    Error: The specified debug interface was not found (list)
    The following debug interfaces are available:
    1: ft2232
    2: amt_jtagaccel
    3: gw16012
    4: usbprog
    5: jlink
    6: vsllink
    7: rlink
    8: ulink
    9: arm-jtag-ew
    10: buspirate
    11: hla
    12: osbdm
    13: opendous
    in procedure 'interface'


Expected Results:  
With the manually configured and built executable, running command:

    openocd -c "interface list"

produces:

    Open On-Chip Debugger 0.7.0 (2013-06-04-23:47)
    Licensed under GNU GPL v2
    For bug reports, read
	    http://openocd.sourceforge.net/doc/doxygen/bugs.html
    Error: The specified debug interface was not found (list)
    The following debug interfaces are available:
    1: ftdi
    in procedure 'interface'


Hello,

I'm attempting to use emerge to build openocd-0.7.0 so that it is configured for the ftdi interface.

In /etc/portage/package.use/openocd, I have:

    dev-embedded/openocd ftdi -ftd2xx

After running "emerge openocd", I run command 

    openocd -c "interface list"

The output is:

    root@osage bugzilla.d # openocd -c "interface list"
    Open On-Chip Debugger 0.7.0 (2013-06-07-16:57)
    Licensed under GNU GPL v2
    For bug reports, read
	    http://openocd.sourceforge.net/doc/doxygen/bugs.html
    Error: The specified debug interface was not found (list)
    The following debug interfaces are available:
    1: ft2232
    2: amt_jtagaccel
    3: gw16012
    4: usbprog
    5: jlink
    6: vsllink
    7: rlink
    8: ulink
    9: arm-jtag-ew
    10: buspirate
    11: hla
    12: osbdm
    13: opendous
    in procedure 'interface'


Alternatively, I can manually unpack the tarball, run "./configure --enable-ftdi" and get what I want.  Building this way, the output of the above command is:

    Open On-Chip Debugger 0.7.0 (2013-06-04-23:47)
    Licensed under GNU GPL v2
    For bug reports, read
	    http://openocd.sourceforge.net/doc/doxygen/bugs.html
    Error: The specified debug interface was not found (list)
    The following debug interfaces are available:
    1: ftdi
    in procedure 'interface'
Comment 1 David Relson 2013-06-07 21:14:10 UTC
Created attachment 350358 [details]
output of emerge --info
Comment 2 David Relson 2013-06-07 21:14:30 UTC
Created attachment 350360 [details]
output of emerge -pqv
Comment 3 David Relson 2013-06-07 21:15:01 UTC
Created attachment 350362 [details]
build log
Comment 4 Markos Chandras (RETIRED) gentoo-dev 2013-06-07 21:56:22 UTC
It is not clear to me what exactly do you ask in this bug
Comment 5 David Relson 2013-06-07 23:43:51 UTC
The ebuild has an "ftdi" use flag.  When specified, the executable that is built should support the ftdi interface.

Command 'openocd -c "interface list"' lists the interfaces supported by openocd.  When use flag 'ftdi' is specified, 'ftdi' should appear in the interface list, but it does not.

In order to use the ftdi interface (which is an upgrade/fix of the ft2232 interface), specifying "ftdi" as a use flag should result in an executable that supports ftdi.
Comment 6 Markos Chandras (RETIRED) gentoo-dev 2013-06-08 14:11:21 UTC
alright let me have a look.
Comment 7 Stuart Longland 2013-06-11 12:08:50 UTC
I stumbled across this problem when trying to build the live git ebuild of OpenOCD.

The fix; ./configure needs to be ran with --enable-ftdi.  This can be achieved by simply adding it to the econf line:

stuartl@vk4msl-mb /tmp $ diff -u openocd-9999.ebuild.old openocd-9999.ebuild
--- openocd-9999.ebuild.old     2013-05-25 08:31:07.000000000 +1000
+++ openocd-9999.ebuild 2013-06-11 22:03:27.929000046 +1000
@@ -99,6 +99,7 @@
        econf \
                $(use_enable dummy) \
                $(use_enable ftdi ft2232_libftdi) \
+               $(use_enable ftdi ftdi) \
                $(use_enable ftd2xx ft2232_ftd2xx) \
                $(use_enable minidriver minidriver-dummy) \
                $(use_enable parport) \

Then you get both ft2232 and ftdi drivers.  There is the suggestion on the OpenOCD list that perhaps the former should be a separate flag, but the above better preserves the existing behaviour of the ebuild.  (And yes, looking at that, I see the 'ftdi ftdi' is redundant; since 'use_enable ftdi' is equivalent.)

http://www.mail-archive.com/openocd-devel@lists.sourceforge.net/msg04103.html suggests the old ft2232 driver could be removed, or at least relegated to legacy status.
Comment 8 Markos Chandras (RETIRED) gentoo-dev 2013-06-11 20:37:24 UTC
(In reply to Stuart Longland from comment #7)
> I stumbled across this problem when trying to build the live git ebuild of
> OpenOCD.
> 
> The fix; ./configure needs to be ran with --enable-ftdi.  This can be
> achieved by simply adding it to the econf line:
> 
> stuartl@vk4msl-mb /tmp $ diff -u openocd-9999.ebuild.old openocd-9999.ebuild
> --- openocd-9999.ebuild.old     2013-05-25 08:31:07.000000000 +1000
> +++ openocd-9999.ebuild 2013-06-11 22:03:27.929000046 +1000
> @@ -99,6 +99,7 @@
>         econf \
>                 $(use_enable dummy) \
>                 $(use_enable ftdi ft2232_libftdi) \
> +               $(use_enable ftdi ftdi) \

This can be replaced with

$(use_enable ftdi)

committed. Thanks

+*openocd-0.7.0-r1 (11 Jun 2013)
+
+  11 Jun 2013; Markos Chandras <hwoarang@gentoo.org> +openocd-0.7.0-r1.ebuild,
+  -openocd-0.7.0.ebuild, openocd-0.6.1.ebuild, openocd-9999.ebuild:
+  Enable the new ftdi interface when using the ftdi useflag. Bug #472622 thanks
+  to Stuart Longland
+


http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/dev-embedded/openocd/openocd-0.7.0-r1.ebuild?revision=1.1&view=markup

http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/dev-embedded/openocd/openocd-9999.ebuild?r1=1.30&r2=1.31