Re: [Openocd-development] inf file for libusb

2009-06-23 Thread Xiaofan Chen
On Tue, Jun 23, 2009 at 10:51 AM, Xiaofan Chen wrote:
> I see. Thanks for the reply. Which JTAG debugger are you using?
> Do you have "lsusb -vvv" output from that?
>
> In the JTAGkey case, it seems to have two JTAG channels and one
> serial port. And it seems to have only two interfaces in the USB
> configurations. This kind of confused me. Does both JTAG channels
> work at the same time with the serial port?
>

It seems to me that Channel B is more used as the Virtual Com port
instead of JTAG interface. I believe they can not be used as a Virtual
Com port and a JTAG interface at the same time (for FT2232x).
So maybe there is an solution.

Remove the 2nd interface from the universal INF file Freddie provided
and maybe we have a solution. I will post this as a separate thread.

-- 
Xiaofan http://mcuee.blogspot.com
___
Openocd-development mailing list
Openocd-development@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/openocd-development


Re: [Openocd-development] inf file for libusb

2009-06-22 Thread Xiaofan Chen
On Tue, Jun 23, 2009 at 10:45 AM, Alain Mouette wrote:
>
> Xiaofan Chen escreveu:
>>
>> Can you use usb serial port if you use Linux? If not, maybe the
>> FTDI driver has some extra ways to make the com port.
>
> Yes, it works great :)
>
> there is only a small glitch that when you restart OpenOCD, the second
> serial port gets reset, loosin it's baudrate.
>
> There is somthing about a kernel reser in the libftdxx driver about a config
> to avoid that, but I didn't have time to test.
>

I see. Thanks for the reply. Which JTAG debugger are you using?
Do you have "lsusb -vvv" output from that?

In the JTAGkey case, it seems to have two JTAG channels and one
serial port. And it seems to have only two interfaces in the USB
configurations. This kind of confused me. Does both JTAG channels
work at the same time with the serial port?

-- 
Xiaofan http://mcuee.blogspot.com
___
Openocd-development mailing list
Openocd-development@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/openocd-development


Re: [Openocd-development] inf file for libusb

2009-06-22 Thread Xiaofan Chen
On Mon, Jun 22, 2009 at 11:55 PM, Gene Smith wrote:
>> Have you tried the following method?
>>
>> Run cmd.exe as admin (under Vista) and
>> D:\libusb-win32-device-bin-0.1.12.1\bin>c:\windows\sys tem32\rundll32
>> libusb0.dll,usb_install_driver_np_rundll olimex.inf
>>
>
> Unfortunately, at least on my XP setup, this does not survive a reboot.
> When I plug in USB after a reboot, it asks me again to install the
> proprietary olimex drivers from CD and the libusb-win32 driver does not
> appear in hardware mgr. If I redo the above command libusb driver comes
> back and XP stops asking me to install drivers on usb pull/plug (until
> the next reboot).

That is a bit strange.

> As I mentioned before, installing the libusb driver with the "update
> driver" right click dialogs never works for me. If it did, maybe it
> would be permanent?

In my experiences, both will be permanent if they work. For me the
console version always works. The manual method sometime does
not work.

Take note the major reason is that the FTDI driver is WHQL. Windows
will favor the WHQL driver over other alternative 3rd party driver. This is
a significant disadvantage of using libusb-win32 for any device which
has already a built-in driver (say HID or USB mass storage or similar)
or a 3rd party WHQL driver.


-- 
Xiaofan http://mcuee.blogspot.com
___
Openocd-development mailing list
Openocd-development@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/openocd-development


Re: [Openocd-development] inf file for libusb

2009-06-22 Thread Xiaofan Chen
On Mon, Jun 22, 2009 at 11:16 PM, Gene Smith wrote:
> Xiaofan Chen wrote:
>>
>> No. By using libusb-win32 device driver as the driver for
>> the Olimex device instead of FTDI driver, you will lost the
>> serial port.
>
> Maybe I was not understanding. I think you are really saying that there
> is *no way* to have the serial port *and* the jtag running together on
> windows with the free drivers. (This is also the impression I got from
> reading all the GPL discussions.) I thought you were originally
> explaining a way to have both.

I am not exactly sure how the extra USB serial port is implemented.
Take note that I do not have a real hardware for testing right now.
Right now the conclusion from those who tried is that the USB serial
port will be gone.

Can you use usb serial port if you use Linux? If not, maybe the
FTDI driver has some extra ways to make the com port.

-- 
Xiaofan http://mcuee.blogspot.com
___
Openocd-development mailing list
Openocd-development@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/openocd-development


Re: [Openocd-development] inf file for libusb

2009-06-22 Thread Gene Smith
Xiaofan Chen wrote:
> 
> Have you tried the following method?
> 
> Run cmd.exe as admin (under Vista) and
> D:\libusb-win32-device-bin-0.1.12.1\bin>c:\windows\sys tem32\rundll32
> libusb0.dll,usb_install_driver_np_rundll olimex.inf
> 

Unfortunately, at least on my XP setup, this does not survive a reboot. 
When I plug in USB after a reboot, it asks me again to install the 
proprietary olimex drivers from CD and the libusb-win32 driver does not 
appear in hardware mgr. If I redo the above command libusb driver comes 
back and XP stops asking me to install drivers on usb pull/plug (until 
the next reboot).

As I mentioned before, installing the libusb driver with the "update 
driver" right click dialogs never works for me. If it did, maybe it 
would be permanent?

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


Re: [Openocd-development] inf file for libusb

2009-06-22 Thread Gene Smith
Xiaofan Chen wrote:
> 
> No. By using libusb-win32 device driver as the driver for
> the Olimex device instead of FTDI driver, you will lost the
> serial port.

Maybe I was not understanding. I think you are really saying that there 
is *no way* to have the serial port *and* the jtag running together on 
windows with the free drivers. (This is also the impression I got from 
reading all the GPL discussions.) I thought you were originally 
explaining a way to have both.

Again, thanks for helping me.

-gene

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


Re: [Openocd-development] inf file for libusb

2009-06-20 Thread Xiaofan Chen
On Fri, Jun 19, 2009 at 6:26 PM, Duane Ellis wrote:
>  >>  I think we should start to collect the inf files too?
>
> Agree, it would be nice to have a "libusb" - INF file for all ftdi based
> chips that point to libusb :-)

I tend to believe this is possible. Just need to collect the different
VID/PIDs and add them to the INF file generated by libusb-win32's
INF wizard.

Even better, it is possible to build a self-install package using
NSIS. There is an example in libusb-win32.
http://libusb-win32.svn.sourceforge.net/viewvc/libusb-win32/trunk/libusb/examples/driver_installer_template.iss?view=markup

Michael's inf file left out the 64bit stuff. I think it should be inclcuded.
There may be Windows XP 64bit users out there. Take note
that libusb-win32 does work under XP 64bit (but not Vista 64bit).

-- 
Xiaofan http://mcuee.blogspot.com
___
Openocd-development mailing list
Openocd-development@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/openocd-development


Re: [Openocd-development] inf file for libusb

2009-06-20 Thread Xiaofan Chen
On Sat, Jun 20, 2009 at 12:48 PM, Gene Smith wrote:
> Xiaofan Chen wrote, On 06/19/2009 07:35 PM:
>
>> Glad to hear that OpenOCD works with the libusb-win32/libftdi
>> combination.
>>
>> As for the com port, if it is part of the device, then using libusb-win32
>> device driver (as the driver of the whole USB composite device) will
>> disable it. That is the side effect.
>
> I notice that there is another "composite usb device" under usb devices
> in dev mgr. I also see it on the list when I run the inf wizard. I think
> you are saying I need to make another inf file for that device (with
> wizard) and replace its microsoft driver with the libusb driver for that
> device too.

No. That may be your other device. I think the FTDI device will
show as a single USB composite device (parent) and two separate
device (child) in device manager. You need to replace them with
a single libusb-win32 device driver.

If your system has other USB composite device, leave them
as it is. You do not want to disturb them.

> That will allow the serial port to work on the olimex (and
> the jtag functionality to continue).

No. By using libusb-win32 device driver as the driver for
the Olimex device instead of FTDI driver, you will lost the
serial port.

> However, if I plug in, say, a usb
> memory stick or my usb camera (mass storage) or a printer it will not be
> seen since the driver is replaced by libusb.

As I said above, you should not do that. You only need to
replace the FTDI driver for your Olimex device (or other Jtag
device based on FT2232x).

> Am I anywhere close to understanding what this means?
>
> Losing the ability to have USB mass storage (or a printer) is kind of
> bad, if I understand what you are saying.

No you do not need to do that. I am just giving an example.
You will not lose USB mass storage or printer function.

> I assume, also, that you don't have these limitations with the
> proprietary ftd2xx driver?

Right. That is the "native" driver for the FTDI device. We normally
would like to use the native driver and native API if that is possible.
For example, for pk2cmd, we use native HID API under Windows
and Mac OS X to access HID device. Under Linux, we use
libusb as the Linux hid device driver is not so efficient to deal
with the PICkit 2 (not a real Human Interface device). It is
possible to use libusb-win32 for Windows and libusb for
Mac OS X for PICkit 2. But we think it is not a very good way
since the user needs to do some extra things. It is not a very
pleasant user experiences for those users. And it will come
back to bite the developers.

That is why I think to go for FTDI device driver and FTD2XX library
is the nature choice. But now there is this GPL complication.

-- 
Xiaofan http://mcuee.blogspot.com
___
Openocd-development mailing list
Openocd-development@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/openocd-development


Re: [Openocd-development] inf file for libusb

2009-06-19 Thread Gene Smith
Xiaofan Chen wrote, On 06/19/2009 07:35 PM:

> Glad to hear that OpenOCD works with the libusb-win32/libftdi
> combination.
>
> As for the com port, if it is part of the device, then using libusb-win32
> device driver (as the driver of the whole USB composite device) will
> disable it. That is the side effect.
>
> http://article.gmane.org/gmane.comp.lib.libusb.devel.windows/2088
> "whole device?
> You have to replace the 'composite device driver' by libusb's device driver.
> It should work then.
> See http://tinyurl.com/dxxnal for an architecture overview.
> This method has one drawback though: your device doesn't work as a
> mass-storage-device or printer any more since Windows will stop loading
> the drivers."
>
> Stephan Meyer (author of libusb-win32) was answering
> the question of how to use libusb-win32 with a usb composite
> device (printer/mass storage/etc).

I notice that there is another "composite usb device" under usb devices 
in dev mgr. I also see it on the list when I run the inf wizard. I think 
you are saying I need to make another inf file for that device (with 
wizard) and replace its microsoft driver with the libusb driver for that 
device too. That will allow the serial port to work on the olimex (and 
the jtag functionality to continue). However, if I plug in, say, a usb 
memory stick or my usb camera (mass storage) or a printer it will not be 
seen since the driver is replaced by libusb.

Am I anywhere close to understanding what this means?

Losing the ability to have USB mass storage (or a printer) is kind of 
bad, if I understand what you are saying.

I assume, also, that you don't have these limitations with the 
proprietary ftd2xx driver?

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


Re: [Openocd-development] inf file for libusb

2009-06-19 Thread Xiaofan Chen
On Sat, Jun 20, 2009 at 12:29 AM, Gene Smith wrote:
>
> I can switch back and forth between jlink and olimex/ftdi OK in openocd
> and debug wiht insight. They both work OK. However, I don't see a new
> serial port in Dev mgr for the olimex. Where should I see this? I only
> see the built-in COM1 when I plug in the olimex ftdi adapter I see no
> new COM ports. (On linux it appeared as /dev/USB0tty and and I could
> send output to minicom.) In windows I only see builtin COM1 in hyperterm
> and on dev mgr.
>
> I tried the "hacked" libusb0.sys driver and it made no difference.

Glad to hear that OpenOCD works with the libusb-win32/libftdi
combination.

As for the com port, if it is part of the device, then using libusb-win32
device driver (as the driver of the whole USB composite device) will
disable it. That is the side effect.

http://article.gmane.org/gmane.comp.lib.libusb.devel.windows/2088
"whole device?
You have to replace the 'composite device driver' by libusb's device driver.
It should work then.
See http://tinyurl.com/dxxnal for an architecture overview.
This method has one drawback though: your device doesn't work as a
mass-storage-device or printer any more since Windows will stop loading
the drivers."

Stephan Meyer (author of libusb-win32) was answering
the question of how to use libusb-win32 with a usb composite
device (printer/mass storage/etc).



-- 
Xiaofan http://mcuee.blogspot.com
___
Openocd-development mailing list
Openocd-development@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/openocd-development


Re: [Openocd-development] inf file for libusb

2009-06-19 Thread Gene Smith
Xiaofan Chen wrote:
> On Fri, Jun 19, 2009 at 11:09 PM, Gene Smith wrote:
>>> That is right. This is an undocumented feature of libusb-win32
>>> that the author of libusb-win32 taught me to use back in 2007.
>>> He is a very nice guy. Unfortunately he seems to be busy lately
>>> so not much progress in the libusb-win32 front.
>>>
>>> More important question. ;-)
>>> Does openocd work with this libusb-win32 driver?
>>>
>> Well, your're a nice guy too for helping with with this! Any yes, it
>> works find with oocd. Not sure if the serial port works but I will try
>> that on windows (it worked OK on linux). Still need to try jlink again
>> on windows oocd (but it is also detected under LibUSB-Win32 Devices when
>> I plug it in). Thanks again!
> 
> I am glad to be of some help. I tried J-Link under Windows using
> libusb-win32 driver and it seems to work fine.
> 
>> P/S: This really needs to documented somewhere (other than random
>> postings) :)
>>
> 
> Yes I agree. Once you confirm this works with OpenOCD, we
> can make a documentation on this topic.
> 
> 

I can switch back and forth between jlink and olimex/ftdi OK in openocd
and debug wiht insight. They both work OK. However, I don't see a new
serial port in Dev mgr for the olimex. Where should I see this? I only
see the built-in COM1 when I plug in the olimex ftdi adapter I see no
new COM ports. (On linux it appeared as /dev/USB0tty and and I could
send output to minicom.) In windows I only see builtin COM1 in hyperterm
and on dev mgr.

I tried the "hacked" libusb0.sys driver and it made no difference.


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


Re: [Openocd-development] inf file for libusb

2009-06-19 Thread Xiaofan Chen
On Fri, Jun 19, 2009 at 11:09 PM, Gene Smith wrote:
>> That is right. This is an undocumented feature of libusb-win32
>> that the author of libusb-win32 taught me to use back in 2007.
>> He is a very nice guy. Unfortunately he seems to be busy lately
>> so not much progress in the libusb-win32 front.
>>
>> More important question. ;-)
>> Does openocd work with this libusb-win32 driver?
>>
>
> Well, your're a nice guy too for helping with with this! Any yes, it
> works find with oocd. Not sure if the serial port works but I will try
> that on windows (it worked OK on linux). Still need to try jlink again
> on windows oocd (but it is also detected under LibUSB-Win32 Devices when
> I plug it in). Thanks again!

I am glad to be of some help. I tried J-Link under Windows using
libusb-win32 driver and it seems to work fine.

>
> P/S: This really needs to documented somewhere (other than random
> postings) :)
>

Yes I agree. Once you confirm this works with OpenOCD, we
can make a documentation on this topic.


-- 
Xiaofan http://mcuee.blogspot.com
___
Openocd-development mailing list
Openocd-development@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/openocd-development


Re: [Openocd-development] inf file for libusb

2009-06-19 Thread Gene Smith
Xiaofan Chen wrote:
> On Fri, Jun 19, 2009 at 10:51 PM, Gene Smith wrote:
>>> Have you tried the following method?
>>>
>>> Run cmd.exe as admin (under Vista) and
>>> D:\libusb-win32-device-bin-0.1.12.1\bin>c:\windows\sys tem32\rundll32
>>> libusb0.dll,usb_install_driver_np_rundll olimex.inf
>>>
>> I didn't see this at first on your previous email down at the bottom.
>> But this works! It is now seeing the device. So you don't need the
>> "driver installations wizards" to install the driver? Thanks!
>>
> 
> That is right. This is an undocumented feature of libusb-win32
> that the author of libusb-win32 taught me to use back in 2007.
> He is a very nice guy. Unfortunately he seems to be busy lately
> so not much progress in the libusb-win32 front.
> 
> More important question. ;-)
> Does openocd work with this libusb-win32 driver?
> 

Well, your're a nice guy too for helping with with this! Any yes, it 
works find with oocd. Not sure if the serial port works but I will try 
that on windows (it worked OK on linux). Still need to try jlink again 
on windows oocd (but it is also detected under LibUSB-Win32 Devices when 
I plug it in). Thanks again!
-gene

P/S: This really needs to documented somewhere (other than random 
postings) :)

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


Re: [Openocd-development] inf file for libusb

2009-06-19 Thread Xiaofan Chen
On Fri, Jun 19, 2009 at 10:51 PM, Gene Smith wrote:
>> Have you tried the following method?
>>
>> Run cmd.exe as admin (under Vista) and
>> D:\libusb-win32-device-bin-0.1.12.1\bin>c:\windows\sys tem32\rundll32
>> libusb0.dll,usb_install_driver_np_rundll olimex.inf
>>
>
> I didn't see this at first on your previous email down at the bottom.
> But this works! It is now seeing the device. So you don't need the
> "driver installations wizards" to install the driver? Thanks!
>

That is right. This is an undocumented feature of libusb-win32
that the author of libusb-win32 taught me to use back in 2007.
He is a very nice guy. Unfortunately he seems to be busy lately
so not much progress in the libusb-win32 front.

More important question. ;-)
Does openocd work with this libusb-win32 driver?

-- 
Xiaofan http://mcuee.blogspot.com
___
Openocd-development mailing list
Openocd-development@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/openocd-development


Re: [Openocd-development] inf file for libusb

2009-06-19 Thread Gene Smith
Xiaofan Chen wrote:
> On Fri, Jun 19, 2009 at 10:21 PM, Gene Smith wrote:
>>> Run inf-wizard.exe from libusb-win32-device-bin-0.1.12.1 directory.
>> I see it in the bin dir.
>>
>>> Click "Next"
>>> Click the correct VID/PID: "0x058B 0x002B USB Composite Device"
>>> Click "Next"
>>> Save the inf file as "ftdi_libusb.inf" in the same directory.
>> The bin dir? (Or does it matter?)
> 
> Yes. That matters.
> 
>> Right, but when I try to "update" the driver, I find the "olimex.inf"
>> that is saved but it always tells me "the specifed location does not
>> contain information about your hardware".
> 
> Hmm, that should not happen. Could you post the Olimex inf
> file content? What is the VID/PID combination?
> 
>> This seems to work find somehow when I installed the jlink. Now the
>> olimex is being difficult. Any idea what I am missing here? (You can
>> have jlink and ftdi/olimex drivers both installed, right?)
>>
> 
> Have you tried the following method?
> 
> Run cmd.exe as admin (under Vista) and
> D:\libusb-win32-device-bin-0.1.12.1\bin>c:\windows\sys tem32\rundll32
> libusb0.dll,usb_install_driver_np_rundll olimex.inf
> 

I didn't see this at first on your previous email down at the bottom. 
But this works! It is now seeing the device. So you don't need the 
"driver installations wizards" to install the driver? Thanks!

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


Re: [Openocd-development] inf file for libusb

2009-06-19 Thread Xiaofan Chen
On Fri, Jun 19, 2009 at 10:21 PM, Gene Smith wrote:
>> Run inf-wizard.exe from libusb-win32-device-bin-0.1.12.1 directory.
>
> I see it in the bin dir.
>
>> Click "Next"
>> Click the correct VID/PID: "0x058B 0x002B USB Composite Device"
>> Click "Next"
>> Save the inf file as "ftdi_libusb.inf" in the same directory.
>
> The bin dir? (Or does it matter?)

Yes. That matters.

> Right, but when I try to "update" the driver, I find the "olimex.inf"
> that is saved but it always tells me "the specifed location does not
> contain information about your hardware".

Hmm, that should not happen. Could you post the Olimex inf
file content? What is the VID/PID combination?

> This seems to work find somehow when I installed the jlink. Now the
> olimex is being difficult. Any idea what I am missing here? (You can
> have jlink and ftdi/olimex drivers both installed, right?)
>

Have you tried the following method?

Run cmd.exe as admin (under Vista) and
D:\libusb-win32-device-bin-0.1.12.1\bin>c:\windows\sys tem32\rundll32
libusb0.dll,usb_install_driver_np_rundll olimex.inf

-- 
Xiaofan http://mcuee.blogspot.com
___
Openocd-development mailing list
Openocd-development@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/openocd-development


Re: [Openocd-development] inf file for libusb

2009-06-19 Thread Gene Smith
Xiaofan Chen wrote:
> On Fri, Jun 19, 2009 at 5:39 PM, Xiaofan Chen wrote:
>> On Fri, Jun 19, 2009 at 5:35 PM, David Brownell wrote:
 For libusb-win32, it is not too bad. You use the INF wizard to create the
 INF file and then point to the directory with the inf file.
>>> This requires a lot of Win32 knowledge.  I never even knew
>>> there *was* such a thing as an INF wizard...
>>>
>> INF wizard is part of libusb-win32. It is actually very easy to use. ;-)
>>
> 
> For example, here is the step to generate an INF file for a FTDI FT2232D
> device (on a Infineon XE166 demo board).
> 
> Run inf-wizard.exe from libusb-win32-device-bin-0.1.12.1 directory.

I see it in the bin dir.

> Click "Next"
> Click the correct VID/PID: "0x058B 0x002B USB Composite Device"
> Click "Next"
> Save the inf file as "ftdi_libusb.inf" in the same directory.

The bin dir? (Or does it matter?)

> Click "Finish"
> That is it. Simple, right?

Right, but when I try to "update" the driver, I find the "olimex.inf" 
that is saved but it always tells me "the specifed location does not 
contain information about your hardware".

This seems to work find somehow when I installed the jlink. Now the 
olimex is being difficult. Any idea what I am missing here? (You can 
have jlink and ftdi/olimex drivers both installed, right?)

> 
> [Version]
> Signature = "$Chicago$"
> provider  = %manufacturer%
> DriverVer = 03/20/2007,0.1.12.1
> CatalogFile = usbcomposite.cat
> CatalogFile.NT = usbcomposite.cat
> CatalogFile.NTAMD64 = usbcomposite_x64.cat
> 
> Class = LibUsbDevices
> ClassGUID = {EB781AAF-9C70-4523-A5DF-642A87ECA567}
> 
> [ClassInstall]
> AddReg=libusb_class_install_add_reg
> 
> [ClassInstall32]
> AddReg=libusb_class_install_add_reg
> 
> [libusb_class_install_add_reg]
> HKR"LibUSB-Win32 Devices"
> HKR,,Icon,,"-20"
> 
> [Manufacturer]
> %manufacturer%=Devices,NT,NTAMD64
> 
> ;--
> ; Files
> ;--
> 
> [SourceDisksNames]
> 1 = "Libusb-Win32 Driver Installation Disk",,
> 
> [SourceDisksFiles]
> libusb0.sys = 1,,
> libusb0.dll = 1,,
> libusb0_x64.sys = 1,,
> libusb0_x64.dll = 1,,
> 
> [DestinationDirs]
> libusb_files_sys = 10,system32\drivers
> libusb_files_sys_x64 = 10,system32\drivers
> libusb_files_dll = 10,system32
> libusb_files_dll_wow64 = 10,syswow64
> libusb_files_dll_x64 = 10,system32
> 
> [libusb_files_sys]
> libusb0.sys
> 
> [libusb_files_sys_x64]
> libusb0.sys,libusb0_x64.sys
> 
> [libusb_files_dll]
> libusb0.dll
> 
> [libusb_files_dll_wow64]
> libusb0.dll
> 
> [libusb_files_dll_x64]
> libusb0.dll,libusb0_x64.dll
> 
> ;--
> ; Device driver
> ;--
> 
> [LIBUSB_DEV]
> CopyFiles = libusb_files_sys, libusb_files_dll
> AddReg= libusb_add_reg
> 
> [LIBUSB_DEV.NT]
> CopyFiles = libusb_files_sys, libusb_files_dll
> 
> [LIBUSB_DEV.NTAMD64]
> CopyFiles = libusb_files_sys_x64, libusb_files_dll_wow64, libusb_files_dll_x64
> 
> [LIBUSB_DEV.HW]
> DelReg = libusb_del_reg_hw
> AddReg = libusb_add_reg_hw
> 
> [LIBUSB_DEV.NT.HW]
> DelReg = libusb_del_reg_hw
> AddReg = libusb_add_reg_hw
> 
> [LIBUSB_DEV.NTAMD64.HW]
> DelReg = libusb_del_reg_hw
> AddReg = libusb_add_reg_hw
> 
> [LIBUSB_DEV.NT.Services]
> AddService = libusb0, 0x0002, libusb_add_service
> 
> [LIBUSB_DEV.NTAMD64.Services]
> AddService = libusb0, 0x0002, libusb_add_service
> 
> [libusb_add_reg]
> HKR,,DevLoader,,*ntkern
> HKR,,NTMPDriver,,libusb0.sys
> 
> ; Older versions of this .inf file installed filter drivers. They are not
> ; needed any more and must be removed
> [libusb_del_reg_hw]
> HKR,,LowerFilters
> HKR,,UpperFilters
> 
> ; Device properties
> [libusb_add_reg_hw]
> HKR,,SurpriseRemovalOK, 0x00010001, 1
> 
> ;--
> ; Services
> ;--
> 
> [libusb_add_service]
> DisplayName= "LibUsb-Win32 - Kernel Driver 03/20/2007, 0.1.12.1"
> ServiceType= 1
> StartType  = 3
> ErrorControl   = 0
> ServiceBinary  = %12%\libusb0.sys
> 
> ;--
> ; Devices
> ;--
> 
> [Devices]
> "USB Composite Device"=LIBUSB_DEV, USB\VID_058b&PID_002b
> 
> [Devices.NT]
> "USB Composite Device"=LIBUSB_DEV, USB\VID_058b&PID_002b
> 
> [Devices.NTAMD64]
> "USB Composite Device"=LIBUSB_DEV, USB\VID_058b&PID_002b
> 
> 
> ;--
> ; Strings
> ;--
> 
> [Strings]
> manufacturer = "(Standard USB Host Controller)"
> 
> Run cmd.exe as admin (under Vista) and
> D:\libusb-win32-device-bin-0.1.12.1\b

Re: [Openocd-development] inf file for libusb

2009-06-19 Thread Xiaofan Chen
On Fri, Jun 19, 2009 at 5:39 PM, Xiaofan Chen wrote:
> On Fri, Jun 19, 2009 at 5:35 PM, David Brownell wrote:
>>> For libusb-win32, it is not too bad. You use the INF wizard to create the
>>> INF file and then point to the directory with the inf file.
>>
>> This requires a lot of Win32 knowledge.  I never even knew
>> there *was* such a thing as an INF wizard...
>>
> INF wizard is part of libusb-win32. It is actually very easy to use. ;-)
>

For example, here is the step to generate an INF file for a FTDI FT2232D
device (on a Infineon XE166 demo board).

Run inf-wizard.exe from libusb-win32-device-bin-0.1.12.1 directory.
Click "Next"
Click the correct VID/PID: "0x058B 0x002B USB Composite Device"
Click "Next"
Save the inf file as "ftdi_libusb.inf" in the same directory.
Click "Finish"
That is it. Simple, right?

[Version]
Signature = "$Chicago$"
provider  = %manufacturer%
DriverVer = 03/20/2007,0.1.12.1
CatalogFile = usbcomposite.cat
CatalogFile.NT = usbcomposite.cat
CatalogFile.NTAMD64 = usbcomposite_x64.cat

Class = LibUsbDevices
ClassGUID = {EB781AAF-9C70-4523-A5DF-642A87ECA567}

[ClassInstall]
AddReg=libusb_class_install_add_reg

[ClassInstall32]
AddReg=libusb_class_install_add_reg

[libusb_class_install_add_reg]
HKR"LibUSB-Win32 Devices"
HKR,,Icon,,"-20"

[Manufacturer]
%manufacturer%=Devices,NT,NTAMD64

;--
; Files
;--

[SourceDisksNames]
1 = "Libusb-Win32 Driver Installation Disk",,

[SourceDisksFiles]
libusb0.sys = 1,,
libusb0.dll = 1,,
libusb0_x64.sys = 1,,
libusb0_x64.dll = 1,,

[DestinationDirs]
libusb_files_sys = 10,system32\drivers
libusb_files_sys_x64 = 10,system32\drivers
libusb_files_dll = 10,system32
libusb_files_dll_wow64 = 10,syswow64
libusb_files_dll_x64 = 10,system32

[libusb_files_sys]
libusb0.sys

[libusb_files_sys_x64]
libusb0.sys,libusb0_x64.sys

[libusb_files_dll]
libusb0.dll

[libusb_files_dll_wow64]
libusb0.dll

[libusb_files_dll_x64]
libusb0.dll,libusb0_x64.dll

;--
; Device driver
;--

[LIBUSB_DEV]
CopyFiles = libusb_files_sys, libusb_files_dll
AddReg= libusb_add_reg

[LIBUSB_DEV.NT]
CopyFiles = libusb_files_sys, libusb_files_dll

[LIBUSB_DEV.NTAMD64]
CopyFiles = libusb_files_sys_x64, libusb_files_dll_wow64, libusb_files_dll_x64

[LIBUSB_DEV.HW]
DelReg = libusb_del_reg_hw
AddReg = libusb_add_reg_hw

[LIBUSB_DEV.NT.HW]
DelReg = libusb_del_reg_hw
AddReg = libusb_add_reg_hw

[LIBUSB_DEV.NTAMD64.HW]
DelReg = libusb_del_reg_hw
AddReg = libusb_add_reg_hw

[LIBUSB_DEV.NT.Services]
AddService = libusb0, 0x0002, libusb_add_service

[LIBUSB_DEV.NTAMD64.Services]
AddService = libusb0, 0x0002, libusb_add_service

[libusb_add_reg]
HKR,,DevLoader,,*ntkern
HKR,,NTMPDriver,,libusb0.sys

; Older versions of this .inf file installed filter drivers. They are not
; needed any more and must be removed
[libusb_del_reg_hw]
HKR,,LowerFilters
HKR,,UpperFilters

; Device properties
[libusb_add_reg_hw]
HKR,,SurpriseRemovalOK, 0x00010001, 1

;--
; Services
;--

[libusb_add_service]
DisplayName= "LibUsb-Win32 - Kernel Driver 03/20/2007, 0.1.12.1"
ServiceType= 1
StartType  = 3
ErrorControl   = 0
ServiceBinary  = %12%\libusb0.sys

;--
; Devices
;--

[Devices]
"USB Composite Device"=LIBUSB_DEV, USB\VID_058b&PID_002b

[Devices.NT]
"USB Composite Device"=LIBUSB_DEV, USB\VID_058b&PID_002b

[Devices.NTAMD64]
"USB Composite Device"=LIBUSB_DEV, USB\VID_058b&PID_002b


;--
; Strings
;--

[Strings]
manufacturer = "(Standard USB Host Controller)"

Run cmd.exe as admin (under Vista) and
D:\libusb-win32-device-bin-0.1.12.1\bin>c:\windows\sys
tem32\rundll32 libusb0.dll,usb_install_driver_np_rundll usbcomposite.inf

Windows will pop up a warning. Click "Install this driver software anyway".

After a while, the new device should be listed in Device Manager as
"LibUSB-Win32 Devices -- USB Composite Device"

D:\libusb-win32-device-bin-0.1.12.1\bin>testlibusb.exe

Dev #0:  - 
  Dev #1: INFINEON - DAS JTAG over USB EK XE167

D:\libusb-win32-device-bin-0.1.12.1\bin>testlibusb-win.exe
A popup window will appear. Here is the content.

DLL version:0.1.12.1
Driver version: 0.1.12.1

bus/device  idVendor/idProduct
bus-0/\\.\libusb0-0001--0x058b-0x002b 058B/002B
- Manufacturer : INFINEON
- Product  : DAS JTAG over USB EK XE167
- Serial Number: EK054019
  wTotalLength: 55

Re: [Openocd-development] inf file for libusb

2009-06-19 Thread Duane Ellis
 >>  I think we should start to collect the inf files too?

Agree, it would be nice to have a "libusb" - INF file for all ftdi based 
chips that point to libusb :-)


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


Re: [Openocd-development] inf file for libusb

2009-06-19 Thread Xiaofan Chen
On Fri, Jun 19, 2009 at 5:35 PM, David Brownell wrote:
>> For libusb-win32, it is not too bad. You use the INF wizard to create the
>> INF file and then point to the directory with the inf file.
>
> This requires a lot of Win32 knowledge.  I never even knew
> there *was* such a thing as an INF wizard...
>
>
>> You can even use the undocumented method to install the driver.
>> rundll32 libusb0.dll,usb_install_driver_np_rundll your_inf_file.inf
>>
>> Details:
>> http://www.nabble.com/-Libusb-win32-devel--HID-device-problem-td5937112.html
>>

INF wizard is part of libusb-win32. It is actually very easy to use. ;-)

I can not code, but I happened to know quite a bit about libusb
and libusb-win32 after playing with USB in my spare time on
and off for almost 4 years.

-- 
Xiaofan http://mcuee.blogspot.com
___
Openocd-development mailing list
Openocd-development@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/openocd-development


Re: [Openocd-development] inf file for libusb

2009-06-19 Thread David Brownell
On Friday 19 June 2009, Xiaofan Chen wrote:
> On Fri, Jun 19, 2009 at 3:13 PM, David Brownell wrote:
> > On Thursday 18 June 2009, Michael Fischer wrote:
> >> I think we should start to collect the inf files too?
> >
> > In SVN?  I'd think so.
> >
> > Along with installation and upgrade instructions,
> > since that's rarely painless on Windows.
> 
> For libusb-win32, it is not too bad. You use the INF wizard to create the
> INF file and then point to the directory with the inf file.

This requires a lot of Win32 knowledge.  I never even knew
there *was* such a thing as an INF wizard...


> You can even use the undocumented method to install the driver.
> rundll32 libusb0.dll,usb_install_driver_np_rundll your_inf_file.inf
> 
> Details:
> http://www.nabble.com/-Libusb-win32-devel--HID-device-problem-td5937112.html
> 
> -- 
> Xiaofan http://mcuee.blogspot.com
> 
> 


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


Re: [Openocd-development] inf file for libusb

2009-06-19 Thread Xiaofan Chen
On Fri, Jun 19, 2009 at 4:06 PM, Xiaofan Chen wrote:
> On Fri, Jun 19, 2009 at 3:13 PM, David Brownell wrote:
>> On Thursday 18 June 2009, Michael Fischer wrote:
>>> I think we should start to collect the inf files too?
>>
>> In SVN?  I'd think so.
>>
>> Along with installation and upgrade instructions,
>> since that's rarely painless on Windows.
>
> For libusb-win32, it is not too bad. You use the INF wizard to create the
> INF file and then point to the directory with the inf file.
>
> You can even use the undocumented method to install the driver.
> rundll32 libusb0.dll,usb_install_driver_np_rundll your_inf_file.inf
>
> Details:
> http://www.nabble.com/-Libusb-win32-devel--HID-device-problem-td5937112.html
>

For example, this is the INF file generated for J-Link (jlink.inf)

[Version]
Signature = "$Chicago$"
provider  = %manufacturer%
DriverVer = 03/20/2007,0.1.12.1
CatalogFile = jlink.cat
CatalogFile.NT = jlink.cat
CatalogFile.NTAMD64 = jlink_x64.cat

Class = LibUsbDevices
ClassGUID = {EB781AAF-9C70-4523-A5DF-642A87ECA567}

[ClassInstall]
AddReg=libusb_class_install_add_reg

[ClassInstall32]
AddReg=libusb_class_install_add_reg

[libusb_class_install_add_reg]
HKR"LibUSB-Win32 Devices"
HKR,,Icon,,"-20"

[Manufacturer]
%manufacturer%=Devices,NT,NTAMD64

;--
; Files
;--

[SourceDisksNames]
1 = "Libusb-Win32 Driver Installation Disk",,

[SourceDisksFiles]
libusb0.sys = 1,,
libusb0.dll = 1,,
libusb0_x64.sys = 1,,
libusb0_x64.dll = 1,,

[DestinationDirs]
libusb_files_sys = 10,system32\drivers
libusb_files_sys_x64 = 10,system32\drivers
libusb_files_dll = 10,system32
libusb_files_dll_wow64 = 10,syswow64
libusb_files_dll_x64 = 10,system32

[libusb_files_sys]
libusb0.sys

[libusb_files_sys_x64]
libusb0.sys,libusb0_x64.sys

[libusb_files_dll]
libusb0.dll

[libusb_files_dll_wow64]
libusb0.dll

[libusb_files_dll_x64]
libusb0.dll,libusb0_x64.dll

;--
; Device driver
;--

[LIBUSB_DEV]
CopyFiles = libusb_files_sys, libusb_files_dll
AddReg= libusb_add_reg

[LIBUSB_DEV.NT]
CopyFiles = libusb_files_sys, libusb_files_dll

[LIBUSB_DEV.NTAMD64]
CopyFiles = libusb_files_sys_x64, libusb_files_dll_wow64, libusb_files_dll_x64

[LIBUSB_DEV.HW]
DelReg = libusb_del_reg_hw
AddReg = libusb_add_reg_hw

[LIBUSB_DEV.NT.HW]
DelReg = libusb_del_reg_hw
AddReg = libusb_add_reg_hw

[LIBUSB_DEV.NTAMD64.HW]
DelReg = libusb_del_reg_hw
AddReg = libusb_add_reg_hw

[LIBUSB_DEV.NT.Services]
AddService = libusb0, 0x0002, libusb_add_service

[LIBUSB_DEV.NTAMD64.Services]
AddService = libusb0, 0x0002, libusb_add_service

[libusb_add_reg]
HKR,,DevLoader,,*ntkern
HKR,,NTMPDriver,,libusb0.sys

; Older versions of this .inf file installed filter drivers. They are not
; needed any more and must be removed
[libusb_del_reg_hw]
HKR,,LowerFilters
HKR,,UpperFilters

; Device properties
[libusb_add_reg_hw]
HKR,,SurpriseRemovalOK, 0x00010001, 1

;--
; Services
;--

[libusb_add_service]
DisplayName= "LibUsb-Win32 - Kernel Driver 03/20/2007, 0.1.12.1"
ServiceType= 1
StartType  = 3
ErrorControl   = 0
ServiceBinary  = %12%\libusb0.sys

;--
; Devices
;--

[Devices]
"J-Link driver"=LIBUSB_DEV, USB\VID_1366&PID_0101

[Devices.NT]
"J-Link driver"=LIBUSB_DEV, USB\VID_1366&PID_0101

[Devices.NTAMD64]
"J-Link driver"=LIBUSB_DEV, USB\VID_1366&PID_0101


;--
; Strings
;--

[Strings]
manufacturer = "Segger"

Then you run the following command to install the J-Link libusb-win32 driver.
C:\\usb\libusb-win32-device-bin-0.1.12.1\bin>rundll32
libusb0.dll,usb_install_driver_np_rundll jlink.inf

You will then notice that it automatically updates the J-Link Segger
driver to libusb-win32. You can see under "Device Manager" that there
is now a new entry called "LibUSB-Win32 Devices --> J-Link Driver"

You can then test it with testlibusb.exe.
C:\usb\libusb-win32-device-bin-0.1.12.1\bin>testlibusb.exe
Dev #0:  - 
  Dev #1: SEGGER - J-Link

You can also test it with the testlibusb-win.exe. A popup window will show
the following (kind of a brief version of lsusb under Linux).
DLL version:0.1.12.1
Driver version: 0.1.12.1

bus/device  idVendor/idProduct
bus-0/\\.\libusb0-0001--0x1366-0x0101 1366/0101
- Manufacturer : SEGGER
- Product  : J-Link
- Serial Number: 123456
  wTotalLength: 32
  bNumInterfaces:   1
  bConfigurationV

Re: [Openocd-development] inf file for libusb

2009-06-19 Thread Xiaofan Chen
On Fri, Jun 19, 2009 at 3:13 PM, David Brownell wrote:
> On Thursday 18 June 2009, Michael Fischer wrote:
>> I think we should start to collect the inf files too?
>
> In SVN?  I'd think so.
>
> Along with installation and upgrade instructions,
> since that's rarely painless on Windows.

For libusb-win32, it is not too bad. You use the INF wizard to create the
INF file and then point to the directory with the inf file.

You can even use the undocumented method to install the driver.
rundll32 libusb0.dll,usb_install_driver_np_rundll your_inf_file.inf

Details:
http://www.nabble.com/-Libusb-win32-devel--HID-device-problem-td5937112.html

-- 
Xiaofan http://mcuee.blogspot.com
___
Openocd-development mailing list
Openocd-development@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/openocd-development


Re: [Openocd-development] inf file for libusb

2009-06-19 Thread David Brownell
On Thursday 18 June 2009, Michael Fischer wrote:
> I think we should start to collect the inf files too?

In SVN?  I'd think so.

Along with installation and upgrade instructions,
since that's rarely painless on Windows.

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