On Wed, Sep 15, 2010 at 8:23 PM, Peter Stuge <pe...@stuge.se> wrote:
> Laurent Gauch wrote:
>> actually I will recommend to still use D2XX drivers and build your
>> openocd for d2xx driver. Why :
>>
>> D2XX driver is actually still faster than libusb driver on Windows ...
>
> Do you know why this is? Have you compared also using libusb-1.0,
> which uses WinUSB.sys?

I've tried to use libftdi-1.0/libusb-1.0 with OpenOCD under Linux and it
is not faster than libftdi/libusb-0.1 since OpenOCD has not been
written to be based on the async API of libftdi-1.0/libusb-1.0.

UrJtag developers have done things to improve the performance
by using the async API of libftdi-1.0.

There was a discussion in the archive of the mailing list.

I've also tried to use libftdi-1.0/libusb-1.0/WinUSB under Windows,
the result is similar.

>
>> D2XX driver is backward compatible with older D2XX ;-), not libusb
>> driver ...
>
> Hm, this would be a problem of libftdi I guess. Do you know if
> current products use older chips?

One thing is that libusb-1.0 Windows right now does not
support libusb0.sys yet. So libusb-1.0 and libusb-Win32
(libusb-0.1) use different driver now.

>> D2XX driver allows to have one only driver for JTAG channel and UART
>> channel ... (VCP D2XX), not the libusb
>
> This is maybe the most significant benefit. But if driver
> installation can be automated then I don't know if it matters anymore.

The above is certainly not true. You can install libusb-win32
driver (or WinUSB driver) to one of the JTAG channel and use
the FTDI driver for the other channel (for VCP).

The inf file Freddie distributes already take care of this.

>> D2XX driver has a true compatibility trough  OS (windows / linux / mac )
>> ...
>
> This is of course also the case for libusb. That, and a straightforward
> API are IMO the most significant benefits of libusb. :)

FTDI D2xx driver under Linux is actually based on libusb-0.1. Its performance
is also inferior to the FTDI driver under Windows.

>> D2XX driver is signed and Micrsoft WHQL certified for 32bits and
>> 64bits, not the libusb
>
> The libusb-win32 driver is signed as well, and I think at least a
> previous version has been WHQL certified. And for many systems
> libusb-1.0 can use WinUSB.sys from Microsoft themselves.

Some of the vendors supplied WHQL driver for FTDI based
JTAG debugger (like FTDI's original VID/PID or Amontec). Other
vendors do not have WHQL driver.

Vendors can also choose to submit WHQL for driver
package based on libusb0.sys or WinUSB.sys.

>> For the Amontec USB JTAG key dongle series please use the
>>
>> http://www.amontec.com/download/amontec-jtagkey-driver-d2xx-20091124.zip
>
> I understand that it is a little too early still, but hopefully
> libusb becomes a viable alternative for you soon. :)
>

Next version of libusb-win32 will provide an easy way to install libusb-win32
filter driver for a specific device (for every individual interface).
In that case,
the users can still use the existing D2xx driver and then use either
openocd_d2xx or openocd_libftdi.

Preview of this feature:
http://libusb-win32.svn.sourceforge.net/viewvc/libusb-win32/branches/libusb-testing/src/install-filter-help.txt?revision=343&view=markup

Test run:

D:\work\openocd\libusb-win32-bin-1.2.1.22\bin\x86>install-filter.exe
install "--device=USB\VID_0403&PID_CFF8&MI_00"

libusb-win32 installer (v1.2.1.22)
stopping libusbd service..
deleting libusbd service..
stopping devices..
creating libusb0 service..
starting devices..
inserting device upper filter libusb0..
inserting device upper filter libusb0..

D:\work\openocd\libusb-win32-bin-1.2.1.22\bin\x86>install-filter.exe
install "--device=USB\VID_0403&PID_CFF8&MI_01"

libusb-win32 installer (v1.2.1.22)
stopping libusbd service..
deleting libusbd service..
removing device upper filter libusb0..
stopping devices..
creating libusb0 service..
starting devices..
inserting device upper filter libusb0..
inserting device upper filter libusb0..

D:\Program Files\OpenOCD\0.4.0\bin>dir
16/01/2010  10:49 AM           113,211 libftdi.dll
22/02/2010  07:05 PM         1,084,928 openocd.exe (from Freddie, stripped)
13/09/2010  08:47 PM         3,932,272 openocd_d2xx.exe (not stripped,
so size is bigger)
              3 File(s)      5,130,411 bytes

D:\Program Files\OpenOCD\0.4.0\bin>openocd -f interface/jtagkey2.cfg
-f board/olimex_lpc_h2148.cfg
Open On-Chip Debugger 0.4.0 (2010-02-22-19:05)
Licensed under GNU GPL v2
For bug reports, read
       http://openocd.berlios.de/doc/doxygen/bugs.html
RCLK - adaptive
jtag_nsrst_delay: 200
jtag_ntrst_delay: 200
trst_and_srst srst_pulls_trst srst_gates_jtag trst_push_pull srst_open_drain
Info : max TCK change to: 30000 kHz
Info : RCLK (adaptive clock speed)
Info : JTAG tap: lpc2148.cpu tap/device found: 0x4f1f0f0f (mfg: 0x787,
part: 0xf1f0, ver: 0x4)
Info : Embedded ICE version 4
Info : lpc2148.cpu: hardware has 2 breakpoint/watchpoint units

D:\Program Files\OpenOCD\0.4.0\bin>openocd_d2xx  -f
interface/jtagkey2.cfg  -f board/olimex_lpc_h2148.cfg
Open On-Chip Debugger 0.4.0 (2010-09-13-20:47)
Licensed under GNU GPL v2
For bug reports, read
       http://openocd.berlios.de/doc/doxygen/bugs.html
RCLK - adaptive
jtag_nsrst_delay: 200
jtag_ntrst_delay: 200
trst_and_srst srst_pulls_trst srst_gates_jtag trst_push_pull srst_open_drain
Info : device: 6 "2232H"
Info : deviceID: 67358712
Info : SerialNumber: 53T9XDR4A
Info : Description: Amontec JTAGkey-2 A
Info : max TCK change to: 30000 kHz
Info : RCLK (adaptive clock speed)
Info : JTAG tap: lpc2148.cpu tap/device found: 0x4f1f0f0f (mfg: 0x787,
part: 0xf1f0, ver: 0x4)
Info : Embedded ICE version 4
Info : lpc2148.cpu: hardware has 2 breakpoint/watchpoint units

Actually by using the current libusb-win32 filter driver, the user can
already achieving the above, however, we do not recommend to
deploy the filter driver in its current form to end users since now
it applies too many USB device based on class concept.


-- 
Xiaofan
_______________________________________________
Openocd-development mailing list
Openocd-development@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/openocd-development

Reply via email to