There is a warning, not so sure if it is really of importance or not.

The good thing is that ST-Link V2 uses Winusb.sys and libusbx
works out of the box, without the need to switch driver.
(ST-Link V1 uses USB Mass Storage driver).

C:\work\libusbx\libusbx-1.0.11-win\examples\bin32>xusb.exe -d 0483:3748
Using libusbx v1.0.11.10499

Opening device...
[timestamp] [threadID] facility level [function call] <message>
--------------------------------------------------------------------------------

[ 0.000000] [000004a0] libusbx: warning [init_device] could not get node connect
ion information for device '\\.\USB#VID_0000&PID_0000#5&2D0620DE&0&1': [87] The
parameter is incorrect.
speed: 12 Mbit/s (USB 1.0 FullSpeed)

Reading device descriptor:
            length: 18
      device class: 0
               S/N: 3
           VID:PID: 0483:3748
         bcdDevice: 0100
   iMan:iProd:iSer: 1:2:3
          nb confs: 1

Reading configuration descriptors:
             nb interfaces: 1
              interface[0]: id = 0
interface[0].altsetting[0]: num endpoints = 3
   Class.SubClass.Protocol: FF.FF.FF
       endpoint[0].address: 81
           max packet size: 0040
          polling interval: 00
       endpoint[1].address: 02
           max packet size: 0040
          polling interval: 00
       endpoint[2].address: 83
           max packet size: 0040
          polling interval: 00

Claiming interface 0...

Reading string descriptors:
   String (0x01): "STMicroelectronics"
   String (0x02): "STM32 STLink"
   String (0x03): "VjIqTIE?

Releasing interface 0...
Closing device...

BTW, xusb's descriptor dumping is a bit ugly.

Here is the output from libusbK's klist.
C:\libusbK-dev-kit>kList.exe
 1. STMicroelectronics STLink dongle (STMicroelectronics) [Connected]
    Service              : WinUSB
    ClassGUID            : {36FC9E60-C465-11CF-8056-444553540000}
    InstanceID           : USB\Vid_0483&Pid_3748\5&11dad59d&0&2
    DeviceInterfaceGUID  : {dbce1cd9-a320-4b51-a365-a0c3f3c5fb29}
    SymbolicLink         : \\?\USB#Vid_0483&Pid_3748#5&11dad59d&0&2#{dbce1cd9-a3
20-4b51-a365-a0c3f3c5fb29}
    DevicePath           : \\?\USB#Vid_0483&Pid_3748#5&11dad59d&0&2#{dbce1cd9-a3
20-4b51-a365-a0c3f3c5fb29}

Select device (1-1) :1

Loading driver api..
Getting descriptors..

-Device:
  bLength             :18
  bDescriptorType     :0x01
  bcdUSB              :0x0200
  bDeviceClass        :0x00 (Defined at Interface level)
  bDeviceSubClass     :0x00
  bDeviceProtocol     :0x00
  bMaxPacketSize0     :64
  idVendor            :0x0483 (SGS Thomson Microelectronics)
  idProduct           :0x3748
  bcdDevice           :0x0100
  iManufacturer       :1 (STMicroelectronics)
  iProduct            :2 (STM32 STLink)
  iSerialNumber       :3 (VjIqTIE?
  bNumConfigurations  :1
!End Device
-Configuration:
  bLength             :9
  bDescriptorType     :0x02
  wTotalLength        :39
  bNumInterfaces      :1
  bConfigurationValue :0x01
  iConfiguration      :0
  bmAttributes        :0x80
  MaxPower            :50 (100ma)
 -Interface:
    bLength             :9
    bDescriptorType     :0x04
    bInterfaceNumber    :0x00
    bAlternateSetting   :0x00
    bNumEndpoints       :3
    bInterfaceClass     :0xFF (Vendor Specific Class)
    bInterfaceSubClass  :0xFF (Vendor Specific Subclass)
    bInterfaceProtocol  :0xFF (Vendor Specific Protocol)
    iInterface          :4 (ST Link)
   -Endpoint:
      bLength             :7
      bDescriptorType     :0x05
      bEndpointAddress    :0x81
      bmAttributes        :0x02 (Bulk)
      wMaxPacketSize      :64
      bInterval           :0x00
   !End Endpoint
   -Endpoint:
      bLength             :7
      bDescriptorType     :0x05
      bEndpointAddress    :0x02
      bmAttributes        :0x02 (Bulk)
      wMaxPacketSize      :64
      bInterval           :0x00
   !End Endpoint
   -Endpoint:
      bLength             :7
      bDescriptorType     :0x05
      bEndpointAddress    :0x83
      bmAttributes        :0x02 (Bulk)
      wMaxPacketSize      :64
      bInterval           :0x00
   !End Endpoint
 !End Interface
!End Configuration

libusb-win32's testlibusb-win.exe output is also nicer
(with libusb0.sys filter)

bus/device  idVendor/idProduct
bus-0/\\.\libusb0-0001--0x0483-0x3748     0483/3748
- Manufacturer : STMicroelectronics
- Product      : STM32 STLink
- Serial Number: VjIqTIE?
bLength:             18
bDescriptorType:     01h
bcdUSB:              0200h
bDeviceClass:        00h
bDeviceSubClass:     00h
bDeviceProtocol:     00h
bMaxPacketSize0:     40h
idVendor:            0483h
idProduct:           3748h
bcdDevice:           0100h
iManufacturer:       1
iProduct:            2
iSerialNumber:       3
bNumConfigurations:  1
  wTotalLength:         39
  bNumInterfaces:       1
  bConfigurationValue:  1
  iConfiguration:       0
  bmAttributes:         80h
  MaxPower:             50
    bInterfaceNumber:   0
    bAlternateSetting:  0
    bNumEndpoints:      3
    bInterfaceClass:    255
    bInterfaceSubClass: 255
    bInterfaceProtocol: 255
    iInterface:         4
      bEndpointAddress: 81h
      bmAttributes:     02h
      wMaxPacketSize:   64
      bInterval:        0
      bRefresh:         0
      bSynchAddress:    0
      bEndpointAddress: 02h
      bmAttributes:     02h
      wMaxPacketSize:   64
      bInterval:        0
      bRefresh:         0
      bSynchAddress:    0
      bEndpointAddress: 83h
      bmAttributes:     02h
      wMaxPacketSize:   64
      bInterval:        0
      bRefresh:         0
      bSynchAddress:    0




-- 
Xiaofan

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
libusbx-devel mailing list
libusbx-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libusbx-devel

Reply via email to