On Sat, Aug 14, 2010 at 8:30 AM, Xiaofan Chen <xiaof...@gmail.com> wrote:
> On Sat, Aug 14, 2010 at 1:48 AM, Olof Tångrot <olof.tang...@telia.com> wrote:
>> Xiaofan Chen wrote:
>>> I am using the original OpenOCD binaries from Freddie Chopin
>>> under 32bit Vista. The driver is the original Amontec driver
>>> (WHQL, based on FTDI's 2.06.00 version) and libusb-win32
>>> filter driver 1.2.1.0. The two config files are also unmodified.
>>>
>> I also started to doubt that openocd actually could work with the
>> LPC2148 since Macraigor OCDCommander seems to be working at least with
>> the wiggler clone.
>> And it is strange that proprietary drivers seems to
>> be the involved your setup.
>
> Ah, I just got the Amontec Amontec JTAGkey2 so I installed
> Amontec's driver first which is based on FTDI driver.
>
> To use libftdi, you need libusb-win32 driver, either device driver
> mode (recommended) or filter driver (which is not recommended
> for normal users, only for power users and developers). It is
> just that I am one of the admins of libusb-win32 and my
> responsibility includes testing the filter driver to improve its
> stability (it is much more stable now, but could still cause
> BSODs in certain cases). So I used the filter driver.
>
> If the filter driver works, normally the device driver will work.
> To prove that, I just used libusb-win32 device driver to replace
> the Amontec driver for Channel A using Zadig. And openocd
> works fine as well. This is under Windows 7 with no filter driver
> enabled.
>
> The inf file generated by Zadig is also attached. In fact, it
> can generate inf file for libusb0.sys and winusb.sys. So I
> can switch between using libftdi (with Freddie Chopin's binary)
> and libftdi-1.0 (with the binary I built). Zadig can also install the
> driver for you or just generate the binary package.
>
> http://www.libusb.org/wiki/windows_backend
>

So I tested the OpenOCD binary I built with libftdi-1.0 support.
libftdi-1.0 is based on libusb-1.0. So under Windows it needs
to use WinUSB driver. Firstly I use Zadig to switch the driver to
WinUSB. Then I run the binary I built.

The WinUSB inf file generated is also attached. Take note
the following line. It only attaches to Interface 0 (Channel A).

DeviceID   = "VID_0403&PID_CFF8&MI_00"

D:\work\openocd\openocd_04Aug2010_mingw32\bin>dir
 Volume in drive D is DATA
 Volume Serial Number is 748A-B2F8

 Directory of D:\work\openocd\openocd_04Aug2010_mingw32\bin

04/08/2010  08:43 PM    <DIR>          .
04/08/2010  08:43 PM    <DIR>          ..
04/08/2010  08:48 PM               655 info.txt
04/08/2010  07:13 PM            76,819 libftdi.dll
03/08/2010  06:18 AM           155,417 libusb-1.0.dll
04/08/2010  07:54 PM         4,091,470 openocd.exe
               4 File(s)      4,324,361 bytes
               2 Dir(s)  58,172,010,496 bytes free

D:\work\openocd\openocd_04Aug2010_mingw32\bin>openocd -f interface/jtagkey2.cfg
 -f board/olimex_lpc_h2148.cfg
Open On-Chip Debugger 0.5.0-dev (2010-08-04-19:54)
Licensed under GNU GPL v2
For bug reports, read
        http://openocd.berlios.de/doc/doxygen/bugs.html
Info : only one transport option; autoselect 'jtag'
RCLK - adaptive
adapter_nsrst_delay: 200
jtag_ntrst_delay: 200
trst_and_srst separate 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: 0xf
1f0, ver: 0x4)
Info : Embedded ICE version 4
Info : lpc2148.cpu: hardware has 2 breakpoint/watchpoint units


; Amontec_JTAGkey-2_(Interface_0).inf
; Copyright (c) 2010 libusb (GNU LGPL)
[Strings]
DeviceName = "Amontec JTAGkey-2 (Interface 0)"
VendorName = "Future Technology Devices International, Ltd"
SourceName = "Amontec JTAGkey-2 (Interface 0) Install Disk"
DeviceID   = "VID_0403&PID_CFF8&MI_00"
DeviceGUID = "{5237123D-5CA6-46B2-9B2C-9EA25BE4079C}"

[Version]
Signature   = "$Windows NT$"
Class       = "libusb (WinUSB) devices"
ClassGuid   = {78a1c341-4539-11d3-b88d-00c04fad5171}
Provider    = "libusb.org"
CatalogFile = Amontec_JTAGkey-2_(Interface_0).cat
DriverVer   = 07/14/2009, 6.1.7600.16385

[ClassInstall32]
Addreg = WinUSBDeviceClassReg

[WinUSBDeviceClassReg]
HKR,,,0,"libusb (WinUSB) devices"
HKR,,Icon,,-20

[Manufacturer]
%VendorName% = libusbDevice_WinUSB,NTx86,NTamd64,NTia64

[libusbDevice_WinUSB.NTx86]
%DeviceName% = USB_Install, USB\%DeviceID%

[libusbDevice_WinUSB.NTamd64]
%DeviceName% = USB_Install, USB\%DeviceID%

[libusbDevice_WinUSB.NTia64]
%DeviceName% = USB_Install, USB\%DeviceID%

[USB_Install]
Include = winusb.inf
Needs   = WINUSB.NT

[USB_Install.Services]
Include    = winusb.inf
AddService = WinUSB,0x00000002,WinUSB_ServiceInstall

[WinUSB_ServiceInstall]
DisplayName   = "WinUSB - Kernel Driver 07/14/2009 6.1.7600.16385"
ServiceType   = 1
StartType     = 3
ErrorControl  = 1
ServiceBinary = %12%\WinUSB.sys

[USB_Install.Wdf]
KmdfService = WINUSB, WinUsb_Install

[WinUSB_Install]
KmdfLibraryVersion = 1.9

[USB_Install.HW]
AddReg = Dev_AddReg

[Dev_AddReg]
HKR,,DeviceInterfaceGUIDs,0x10000,%DeviceGUID%

[USB_Install.CoInstallers]
AddReg    = CoInstallers_AddReg
CopyFiles = CoInstallers_CopyFiles

[CoInstallers_AddReg]
HKR,,CoInstallers32,0x00010000,"WdfCoInstaller01009.dll,WdfCoInstaller","WinUSBCoInstaller2.dll"

[CoInstallers_CopyFiles]
WinUSBCoInstaller2.dll
WdfCoInstaller01009.dll

[DestinationDirs]
CoInstallers_CopyFiles = 11

[SourceDisksNames]
1 = %SourceName%

[SourceDisksFiles.x86]
WinUSBCoInstaller2.dll  = 1,x86
WdfCoInstaller01009.dll = 1,x86

[SourceDisksFiles.amd64]
WinUSBCoInstaller2.dll  = 1,amd64
WdfCoInstaller01009.dll = 1,amd64

[SourceDisksFiles.ia64]
WinUSBCoInstaller2.dll  = 1,ia64
WdfCoInstaller01009.dll = 1,ia64



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

Reply via email to