[patch #8967] Change ft2xx library to ftdi_syncbb instead of libusb

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

[patch #8967] Change ft2xx library to ftdi_syncbb instead of libusb

Kevin Cuzner-2
URL:
  <http://savannah.nongnu.org/patch/?8967>

                 Summary: Change ft2xx library to ftdi_syncbb instead of
libusb
                 Project: AVR Downloader/UploaDEr
            Submitted by: rs_alexey
            Submitted on: Пнд 04 Апр 2016 12:15:05
                Category: None
                Priority: 5 - Normal
                  Status: None
                 Privacy: Public
             Assigned to: None
        Originator Email:
             Open/Closed: Open
         Discussion Lock: Any

    _______________________________________________________

Details:

FT2XX is more stable and drivers for windows is signed.
This patch changes libusb to ft2xx to ftdi_syncbb (FT245R and FT232R).

To compile you need:
1. patch sources
2. execute aclocal
3. autoconf
4. update config.guess to the newest
5. configure && make


 




    _______________________________________________________

File Attachments:


-------------------------------------------------------
Date: Пнд 04 Апр 2016 12:15:05  Name: avrdude-6.3-diff.tar.gz  Size: 7kB
  By: rs_alexey

<http://savannah.nongnu.org/patch/download.php?file_id=36833>

    _______________________________________________________

Reply to this item at:

  <http://savannah.nongnu.org/patch/?8967>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.nongnu.org/


_______________________________________________
avrdude-dev mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/avrdude-dev
Reply | Threaded
Open this post in threaded view
|

Re: [patch #8967] Change ft2xx library to ftdi_syncbb instead of libusb

Didrik Madheden
I stand to be corrected on this, but I believe the policy is that the
official branch will default to linking to a free (libre) library if a
choice exists. Therefore, I suspect your patch will be rejected.

On 4 April 2016 at 14:15, Alexey Reshetnikov <[hidden email]> wrote:

> URL:
>   <http://savannah.nongnu.org/patch/?8967>
>
>                  Summary: Change ft2xx library to ftdi_syncbb instead of
> libusb
>                  Project: AVR Downloader/UploaDEr
>             Submitted by: rs_alexey
>             Submitted on: Пнд 04 Апр 2016 12:15:05
>                 Category: None
>                 Priority: 5 - Normal
>                   Status: None
>                  Privacy: Public
>              Assigned to: None
>         Originator Email:
>              Open/Closed: Open
>          Discussion Lock: Any
>
>     _______________________________________________________
>
> Details:
>
> FT2XX is more stable and drivers for windows is signed.
> This patch changes libusb to ft2xx to ftdi_syncbb (FT245R and FT232R).
>
> To compile you need:
> 1. patch sources
> 2. execute aclocal
> 3. autoconf
> 4. update config.guess to the newest
> 5. configure && make
>
>
>
>
>
>
>
>     _______________________________________________________
>
> File Attachments:
>
>
> -------------------------------------------------------
> Date: Пнд 04 Апр 2016 12:15:05  Name: avrdude-6.3-diff.tar.gz  Size: 7kB
>   By: rs_alexey
>
> <http://savannah.nongnu.org/patch/download.php?file_id=36833>
>
>     _______________________________________________________
>
> Reply to this item at:
>
>   <http://savannah.nongnu.org/patch/?8967>
>
> _______________________________________________
>   Message sent via/by Savannah
>   http://savannah.nongnu.org/
>
>
> _______________________________________________
> avrdude-dev mailing list
> [hidden email]
> https://lists.nongnu.org/mailman/listinfo/avrdude-dev



--
/Didrik

_______________________________________________
avrdude-dev mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/avrdude-dev
Reply | Threaded
Open this post in threaded view
|

[patch #8967] Change ft2xx library to ftdi_syncbb instead of libusb

Kevin Cuzner-2
In reply to this post by Kevin Cuzner-2
Follow-up Comment #1, patch #8967 (project avrdude):

Well, from a licensing point of view, it's somewhat questionable
whether we'd really like to introduce a dependency on a
closed-source library in code licensed under GPL.  Such
dependencies are always tolerable if the library qualifies
as a "system library" (otherwise, you could not use GPL
software on a closed-source OS), but ftd2xx would certainly
not qualify as such.

Second, there are a number of platforms AVRDUDE supports
where libftd2xx is not available at all (*BSD, Solaris).

I'd like to see the real benefit of such an implementation
before having that in the code.  However, it makes more sense
to discuss that on the mailing list rather than in a patch
tracker.  In particular, your submission suggests the
existing implementation were less stable, so we certainly
ought to fix that.  (OK, the signed driver for Windows is
accepted as a benefit.)

Finally, some stylistic issues:

* If at all, the use of ftd2xx must be completely optional,
so people who cannot or don't want to install it don't lose
any functionality.  Replacing the existing ft245r.c
implementation is thus not acceptabel.


#elif defined(HAVE_LIBFTDI)&&(defined(HAVE_USB_H)||defined(HAVE_LUSB0_USB_H))


* Spaces and braces are welcome. ;-)

* If you wrote the file, please add your name in the copyright
header.

* In the comment in ftd2xx_initialize, there are non-ASCII,
non-ISO8859-1, non-UTF-8 characters. ('\x93', '\x94')



    _______________________________________________________

Reply to this item at:

  <http://savannah.nongnu.org/patch/?8967>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.nongnu.org/


_______________________________________________
avrdude-dev mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/avrdude-dev
Reply | Threaded
Open this post in threaded view
|

Re: [patch #8967] Change ft2xx library to ftdi_syncbb instead of libusb

alexey
Здравствуйте, Joerg.

Вы писали 4 апреля 2016 г., 23:59:27:

> Well, from a licensing point of view, it's somewhat questionable
> whether we'd really like to introduce a dependency on a
> closed-source library in code licensed under GPL.  Such
> dependencies are always tolerable if the library qualifies
> as a "system library" (otherwise, you could not use GPL
> software on a closed-source OS), but ftd2xx would certainly
> not qualify as such.

This library installs in Windows 8, 8.1 and 10 (maybe 7 too) with standard
drivers when I plug ft232rl device. I think for this reason is can be qualified
as a "system library".

> Second, there are a number of platforms AVRDUDE supports
> where libftd2xx is not available at all (*BSD, Solaris).

> I'd like to see the real benefit of such an implementation
> before having that in the code.  However, it makes more sense
> to discuss that on the mailing list rather than in a patch
> tracker.  In particular, your submission suggests the
> existing implementation were less stable, so we certainly
> ought to fix that.  (OK, the signed driver for Windows is
> accepted as a benefit.)

Libusb is not stable in Windows systems. It is always hangs, don`t closes sessions
and work very slow. It was main reason to rewrite sources. There is lots of
projects, that have Avrdude 5.10 with ftd2xx supporting patch in the Internet.
But 5.10 is very old version. I would like to use latest version with ftd2xx support.

> Finally, some stylistic issues:
> * If at all, the use of ftd2xx must be completely optional,
> so people who cannot or don't want to install it don't lose
> any functionality.  Replacing the existing ft245r.c
> implementation is thus not acceptabel.

For now patch replaces existing ft245r.c but if this idea can be live,
it can be realized as option and use ftd2xx instead of libusb only when
it is needed. Like compiling with different versions of libusb and libftdi.

> * If you wrote the file, please add your name in the copyright
> header.

It is not whole mine code. It is compilation of current ft245r.c and
first version of ft245r.c from Avrdude 5.10. Comments in this files stay
without changes.


--
С уважением,
 Alexey                          mailto:[hidden email]
__________________________

+7(960)236-3450
_______________________________________________
avrdude-dev mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/avrdude-dev
Reply | Threaded
Open this post in threaded view
|

Re: [patch #8967] Change ft2xx library to ftdi_syncbb instead of libusb

Xiaofan Chen
On Tue, Apr 5, 2016 at 2:51 PM,  <[hidden email]> wrote:
>
> Libusb is not stable in Windows systems. It is always hangs, don`t
> closes sessions and work very slow. It was main reason to rewrite sources.

I have to contested this as a libusb and libusb-win32 project admin.

libusb-win32 and libusb-1.0 for Windows are both quite stable now
and have been used by many project. Maybe you are still based
your opinion on the old version of libusb-win32 (0.1.x version) which
was unstable under Windows Vista/7/etc.

OpenOCD project has re-written the ftd2xx/libftdi based backend
for FTDI based JTAG debuggers to libusb-1.0 based mpsse and the
speed increased by quite a bit (using asynchronous API).

Ref:
http://repo.or.cz/openocd.git/blob/HEAD:/src/jtag/drivers/mpsse.c

After that, the libftdi/ftd2xx driver was deprecated.
   http://openocd.zylin.com/#/c/1899/

Just FYI, ftd2xx under Linux is based on libusb-1.0.

So if you need the performance, swith to libusb-1.0
asynchronous API.

As for Driver installation, it is not really that difficult when
switching driver using applications like Zadig, Zadig
works well under Windows 8.1 and Windows 10.
    http://zadig.akeo.ie/

--
Xiaofan

_______________________________________________
avrdude-dev mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/avrdude-dev
Reply | Threaded
Open this post in threaded view
|

Re: [patch #8967] Change ft2xx library to ftdi_syncbb instead of libusb

Joerg Wunsch
In reply to this post by alexey
As Xiaofan Chen wrote:

> libusb-win32 and libusb-1.0 for Windows are both quite stable now
> and have been used by many project. Maybe you are still based
> your opinion on the old version of libusb-win32 (0.1.x version) which
> was unstable under Windows Vista/7/etc.

Алексей, any opinion on that?

> OpenOCD project has re-written the ftd2xx/libftdi based backend
> for FTDI based JTAG debuggers to libusb-1.0 based mpsse and the
> speed increased by quite a bit (using asynchronous API).

AVRDUDE uses libusb-1.0 when it is avaiable.  It's probably not
present in my MinGW32 w32 cross-compilation builds though.

> Just FYI, ftd2xx under Linux is based on libusb-1.0.

:)

I wonder why they don't make it opensource then.


As [hidden email] wrote:

> This library installs in Windows 8, 8.1 and 10 (maybe 7 too) with standard
> drivers when I plug ft232rl device. I think for this reason is can be qualified
> as a "system library".

For Windows, perhaps.  I wouldn't want to put too much effort into a
legal debate.  From a GPL point of view, linking against a
closed-source library is a bit of a "borderline" thing.

> For now patch replaces existing ft245r.c but if this idea can be live,
> it can be realized as option and use ftd2xx instead of libusb only when
> it is needed. Like compiling with different versions of libusb and libftdi.

I am not completely opposed to it, as long as it remains optional.
Preferrably, not even autodetected but with an --with-ft2xx configure
option, so even people who have installed FT2XX can voluntarily decide
whether they'd like to have their AVRDUDE build linked against it or
not.

> > * If you wrote the file, please add your name in the copyright
> > header.
>
> It is not whole mine code. It is compilation of current ft245r.c and
> first version of ft245r.c from Avrdude 5.10. Comments in this files stay
> without changes.

OK, then, at least, add your name, as well as an updated year.

Depending on how many things you've changed, you might also think about
#ifdef'ing it inside the existing implementation.
--
cheers, Joerg               .-.-.   --... ...--   -.. .  DL8DTL

http://www.sax.de/~joerg/
Never trust an operating system you don't have sources for. ;-)

_______________________________________________
avrdude-dev mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/avrdude-dev
Reply | Threaded
Open this post in threaded view
|

Re: [patch #8967] Change ft2xx library to ftdi_syncbb instead of libusb

Didrik Madheden
On 7 April 2016 at 08:19, Joerg Wunsch <[hidden email]> wrote:
>> For now patch replaces existing ft245r.c but if this idea can be live,
>> it can be realized as option and use ftd2xx instead of libusb only when
>> it is needed. Like compiling with different versions of libusb and libftdi.
>
> I am not completely opposed to it, as long as it remains optional.
> Preferrably, not even autodetected but with an --with-ft2xx configure
> option, so even people who have installed FT2XX can voluntarily decide
> whether they'd like to have their AVRDUDE build linked against it or
> not.

I think there is a point to having an official binary with support
FT2xx. It would be for the benefit of exactly those who don't have the
skill or time to build their own avrdude. This also intersects with a
previous suggestion of mine for the Windows build, which was frowned
upon at that time. You could conditionally load DLLs on demand using
the LoadLibrary API function, instead of statically linking them.
Avrdude could handle missing libraries gracefully instead of failing
with an OS error message that a DLL is missing before avrdude even has
a chance to run. This would already make avrdude more useful for
people using avrdude only for serial style programmers, so they won't
need to find a libusb dll just to let the program run. Doing this, the
Windows version could be shipped with complete functionality without
depending on which DLLs are available to run at all.

--
/Didrik

_______________________________________________
avrdude-dev mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/avrdude-dev
Reply | Threaded
Open this post in threaded view
|

Re: [patch #8967] Change ft2xx library to ftdi_syncbb instead of libusb

Joerg Wunsch
As Didrik Madheden wrote:

> I think there is a point to having an official binary with support
> FT2xx. It would be for the benefit of exactly those who don't have the
> skill or time to build their own avrdude.

Well, I already find it quite ironic that there's apparently nobody
else but me who is willing to contribute Win32 binary builds for
AVRDUDE. --- Me, who I doesn't use Windows at all, and who
cross-compiles them under FreeBSD in a MinGW32 environment.

I thus figure, the demand for even a diversity of Win32 builds must be
small enough that nobody feels bothered to do it.  C'mon, compiling a
pile of source code is not rocket science.  It's just installing a
bunch of tools, and running them.  One doesn't even have to understand
a single line of the source code for that.

> You could conditionally load DLLs on demand using
> the LoadLibrary API function, instead of statically linking them.
> Avrdude could handle missing libraries gracefully instead of failing
> with an OS error message that a DLL is missing before avrdude even has
> a chance to run.

This requires a major restructuring of the code.

Right now, the ability to compile against certain libraries, and thus
enable various pieces of code (or not), is detected by configure, and
the code adapts to it using #ifdef.

With your suggestion, all code needs to be compiled, pretending the
library existed on the target platform (which would, at the very
least, require those librarie's header files being present at compile
time), and then dynamically decide which modules can be offered to the
user and which can't.

I'm not opposed to that, provided 1) someone (not me!) actually
implements it, 2) that someone also implements the Posix dlopen()
counterpart (so all non-Windows platforms would gain the same
functionality), and 3) that someone tests the entire stuff against at
least the more important programming adapters.  Certainly, that
magically someone would not be left alone for the job, however, she'd
have to be the driving force for implementing and testing it.
--
cheers, Joerg               .-.-.   --... ...--   -.. .  DL8DTL

http://www.sax.de/~joerg/
Never trust an operating system you don't have sources for. ;-)

_______________________________________________
avrdude-dev mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/avrdude-dev
Reply | Threaded
Open this post in threaded view
|

Re: [patch #8967] Change ft2xx library to ftdi_syncbb instead of libusb

Didrik Madheden
On 9 April 2016 at 00:48, Joerg Wunsch <[hidden email]> wrote:
> I'm not opposed to that, provided 1) someone (not me!) actually
> implements it, 2) that someone also implements the Posix dlopen()
> counterpart (so all non-Windows platforms would gain the same
> functionality), and 3) that someone tests the entire stuff against at
> least the more important programming adapters.  Certainly, that
> magically someone would not be left alone for the job, however, she'd
> have to be the driving force for implementing and testing it.

I'd be willing to give this a shot as far as 1) goes, and 3) to the
best of my abilities (for programmers I have, or can easily build or
cheaply acquire.) I don't, however, really see the necessity for point
2. Typically, non-Windows platforms have either a compiler available
or a package management system, if not both. Except perhaps OSX, which
is the platform I have the least experience using avrdude on. The
reason this makes sense for Windows is the lack of those things on a
typical user system (compiler and sane package management.)

--
/Didrik

_______________________________________________
avrdude-dev mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/avrdude-dev
Reply | Threaded
Open this post in threaded view
|

Re: [patch #8967] Change ft2xx library to ftdi_syncbb instead of libusb

René Liebscher
In reply to this post by Kevin Cuzner-2
   Hi,
   just another idea.
   Would it be possible to put a new programmer into a shared library and
   load it as plugin into avrdude? Then you probably had to define some
   function register_programmer() in the plugin and either link it against
   avrdude or libavrdude or provide same table of function pointers to be
   used by the plugin.
   This way it could be maintained separately from avrdude and may be it
   could even use some other proprietary libraries?
   René

   Joerg Wunsch <[hidden email]>schrieb:

     As Didrik Madheden wrote:
     > I think there is a point to having an official binary with support
     > FT2xx. It would be for the benefit of exactly those who don't have
     the
     > skill or time to build their own avrdude.
     Well, I already find it quite ironic that there's apparently nobody
     else but me who is willing to contribute Win32 binary builds for
     AVRDUDE. --- Me, who I doesn't use Windows at all, and who
     cross-compiles them under FreeBSD in a MinGW32 environment.
     I thus figure, the demand for even a diversity of Win32 builds must
     be
     small enough that nobody feels bothered to do it. C'mon, compiling a
     pile of source code is not rocket science. It's just installing a
     bunch of tools, and running them. One doesn't even have to
     understand
     a single line of the source code for that.
     > You could conditionally load DLLs on demand using
     > the LoadLibrary API function, instead of statically linking them.
     > Avrdude could handle missing libraries gracefully instead of
     failing
     > with an OS error message that a DLL is missing before avrdude even
     has
     > a chance to run.
     This requires a major restructuring of the code.
     Right now, the ability to compile against certain libraries, and
     thus
     enable various pieces of code (or not), is detected by configure,
     and
     the code adapts to it using #ifdef.
     With your suggestion, all code needs to be compiled, pretending the
     library existed on the target platform (which would, at the very
     least, require those librarie's header files being present at
     compile
     time), and then dynamically decide which modules can be offered to
     the
     user and which can't.
     I'm not opposed to that, provided 1) someone (not me!) actually
     implements it, 2) that someone also implements the Posix dlopen()
     counterpart (so all non-Windows platforms would gain the same
     functionality), and 3) that someone tests the entire stuff against
     at
     least the more important programming adapters. Certainly, that
     magically someone would not be left alone for the job, however,
     she'd
     have to be the driving force for implementing and testing it.
     --
     cheers, Joerg .-.-. --... ...-- -.. . DL8DTL
     [1]http://www.sax.de/~joerg/
     Never trust an operating system you don't have sources for. ;-)
     _______________________________________________
     avrdude-dev mailing list
     [hidden email]
     [2]https://lists.nongnu.org/mailman/listinfo/avrdude-dev

References

   1. http://www.sax.de/~joerg/
   2. https://lists.nongnu.org/mailman/listinfo/avrdude-dev
_______________________________________________
avrdude-dev mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/avrdude-dev