This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Product and Vendor ID

Hello,

I am using EVMK2E. In order to write drivers in I need vendor id and product id of the usb on the board. Please suggest me where can i find that?

Regards,

  • Hi Joseph,

    I would suggest you to first, have a look at all the descriptor such as Device Descriptor, Configuration Descriptors, Interface Descriptor, Endpoint Descriptor and String Descriptor,details and its purpose.

    The two fields, Vendor ID and product ID are part of Device descriptors.

    Actually these two fields are used and assigned by the manufacturers of the USB devices. When theses USB devices are connected to the host machines( i.e., PC), during enumeration phase, the host sends the standard USB requests (usually 11 ) to query the device and the device responds to the host with all the above mentioned five types of descriptor details. ( which includes the product ID and the Vendor ID)

    Product ID:

    Even in the application code, the product ID can be set. It is upto the USb device developer decision. Either it can be stored in memory or just in the code.

    Usually, in the device driver, they will maintain a structure somehting like below and having the values set.

    -------------------------------------------------------


    typedef struct { // //! The length of this descriptor in bytes. All device descriptors are //! 18 bytes long. // unsigned char bLength; // //! The type of the descriptor. For a device descriptor, this will be //! USB_DTYPE_DEVICE (1). // unsigned char bDescriptorType; // //! The USB Specification Release Number in BCD format. For USB 2.0, this //! will be 0x0200. // unsigned short bcdUSB; // //! The device class code. // unsigned char bDeviceClass; // //! The device subclass code. This value qualifies the value found in the //! bDeviceClass field. // unsigned char bDeviceSubClass; // //! The device protocol code. This value is qualified by the values of //! bDeviceClass and bDeviceSubClass. // unsigned char bDeviceProtocol; // //! The maximum packet size for endpoint zero. Valid values are 8, 16, 32 //! and 64. // unsigned char bMaxPacketSize0; // //! The device Vendor ID (VID) as assigned by the USB-IF. // unsigned short idVendor; // //! The device Product ID (PID) as assigned by the manufacturer. // unsigned short idProduct; // //! The device release number in BCD format. // unsigned short bcdDevice; // //! The index of a string descriptor describing the manufacturer. // unsigned char iManufacturer; // //! The index of a string descriptor describing the product. // unsigned char iProduct; // //! The index of a string descriptor describing the device's serial //! number. // unsigned char iSerialNumber; // //! The number of possible configurations offered by the device. This //! field indicates the number of distinct configuration descriptors that //! the device offers. // unsigned char bNumConfigurations; } USBLIB_PACKED tDeviceDescriptor;

    -------------------------------------------------------

    Vendor ID:

    Vendor ID is assigned by USB org. Something like below

    Vendors, devices and interfaces. Please keep sorted.
    
    # Syntax:
    # vendor  vendor_name
    #	device  device_name				<-- single tab
    #		interface  interface_name		<-- two tabs
    
    0001  Fry's Electronics
    	7778  Counterfeit flash drive [Kingston]
    0002  Ingram
    0003  Club Mac
    0004  Nebraska Furniture Mart
    0011  Unknown
    	7788  Flash mass storage drive
    0053  Planex
    	5301  GW-US54ZGL 802.11bg
    0079  DragonRise Inc.
    	0006  PC TWIN SHOCK Gamepad
    	0011  Gamepad
    0105  Trust International B.V.
    	145f  NW-3100 802.11b/g 54Mbps Wireless Network Adapter [zd1211]
    0127  IBP
    	0002  HDM Interface
    0145  Unknown
    	0112  Card Reader
    017c  MLK

    -------------------------------------------------------

    Regards,

    Shankari

    -------------------------------------------------------------------------------------------------------

    Please click the Verify Answer button on this post if it answers your question.
    --------------------------------------------------------------------------------------------------------