next up previous contents
Next: 5.3 DriverWizard Notes Up: 5. Using DriverWizard Previous: 5.1 An Overview   Contents


5.2 DriverWizard Walkthrough

To use DriverWizard:

  1. Attach your hardware to the computer:
    Attach your device to a USB port on your computer.

  2. Run DriverWizard and select your device:

        (a)
    Click Start | Programs | WinDriver | DriverWizard or double click the DriverWizard icon on your desktop (on Windows), or run the wdwizard utility from the WinDriver/wizard/ directory.

        (b)
    Click New host driver project to start a new project, or Open an existing project to open a saved session.

    Figure 5.1: Create or Open a WinDriver Project
    Image wiz_start

        (c)
    Select your Device from the list of devices detected by DriverWizard.

    Figure 5.2: Select Your Device
    Image wiz_usb_select_device

    ****************************************************************************************
      NOTE
      On Windows 98, if you do not see your USB device in the list, reconnect it and make sure the New Hardware Found/Add New Hardware wizard appears for your device. Do not close the dialogue box until you have generated an INF for your device using the steps below.
    ****************************************************************************************

  3. Generate an INF file for DriverWizard:

    When developing a driver for a Plug and Play Windows operating system (i.e., Windows 98/Me/2000/XP/Server 2003/Vista) you are required to install an INF file for your device. This file will register your Plug and Play device to work with the windrvr6.sys driver. The file generated by the DriverWizard in this step should later be distributed to your customers using Windows 98/Me/2000/XP/Server 2003/Vista, and installed on their PCs.
    The INF file you generate here is also designed to enable DriverWizard to diagnose your device. As explained earlier, this is required only when using WinDriver to support a Plug and Play device (such as USB) on a Plug and Play system (Windows 98/Me/2000/XP/Server 2003/Vista). Additional information concerning the need for an INF file is explained in section 12.1.1.

    If you do not need to generate an INF file (e.g. if you are using DriverWizard on Linux), skip this step and proceed to the next one.

    To generate the INF file with the DriverWizard, follow the steps below:

        (a)
    In the Select Your Device screen, click the Generate .INF file button or click Next.

        (b)
    DriverWizard will display information detected for your device - Vendor ID, Product ID, Device Class, manufacturer name and device name - and allow you to modify this information.

    Figure 5.3: DriverWizard INF File Information
    Image wiz_usb_inf_info

        (c)
    For multiple-interface USB devices, you can select to generate an INF file either for the composite device or for a specific interface.

    • When selecting to generate an INF file for a specific interface of a multi-interface USB device the INF information dialogue will indicate for which interface the INF file is generated.

      Figure 5.4: DriverWizard Multi-Interface INF File Information - Specific Interface
      Image wiz_usb_inf_info_multi_ifc_ifc0

    • When selecting to generate an INF file for a composite device of a multi-interface USB device, the INF information dialogue provides you with the option to either generate an INF file for the root device itself, or generate an INF file for specific interfaces, which you can select from the dialogue.
      Selecting to generate an INF file for the root device will enable you to handle multiple active interfaces simultaneously.

      Figure 5.5: DriverWizard Multi-Interface INF File Information - Composite Device
      Image wiz_usb_inf_info_multi_ifc_comp

        (d)
    When you are done, click Next and choose the directory in which you wish to store the generated INF file. DriverWizard will then automatically generate the INF file for you.

    On Windows 2000/XP/Server 2003/Vista you can choose to automatically install the INF file from the DriverWizard by checking the Automatically Install the INF file option in the DriverWizard's INF generation dialogue (this option is checked by default for USB devices).
    On Windows 98/Me you must install the INF file manually, using Windows Add New Hardware Wizard or Upgrade Device Driver Wizard, as explained in section 12.1.

    If the automatic INF file installation on Windows 2000/XP/Server 2003/Vista fails, DriverWizard will notify you and provide manual installation instructions for this OS as well.

        (e)
    When the INF file installation completes, select and open your device from the list in the Select Your Device screen.

  4. Uninstall the INF file of your device:
    You can use the Uninstall option to uninstall the INF file of your device. Once you uninstall the INF file, the device will no longer be registered to work with the windrvr6.sys, and the INF file will be deleted from the Windows root directory. If you do not need to uninstall an INF file, skip this step and proceed to the next one.

        (a)
    In the Select Your Device screen, click the Uninstall .INF file button.
        (b)
    Select the INF file to be removed.

  5. Select the desired alternate setting:

    Figure 5.6: Select Device Interface
    Image wiz_usb_select_dev_ifc

    The DriverWizard detects all the device's supported alternate settings and displays them. Select the desired alternate setting from the displayed list.

    DriverWizard will display the pipes information for the selected alternate setting.

    ****************************************************************************************
      NOTE
      For USB devices with only one alternate setting configured, DriverWizard automatically selects the detected alternate setting and therefore the Select Device Interface dialogue will not be displayed.
    ****************************************************************************************

  6. Diagnose your device:
    Before writing your device driver, it is important to make sure your hardware is working as expected. Use DriverWizard to diagnose your hardware. All of your activity will be logged in the DriverWizard log so that you may later analyze your tests:

        (a)
    Test your USB device's pipes: DriverWizard shows the pipes detected for the selected alternate setting. To perform USB data transfers on the pipes, follow these steps:

        i.
    Select the desired pipe.

        ii.
    For a control pipe (a bidirectional pipe), click Read / Write. A new dialogue will appear, allowing you to select a standard USB request or define a custom request, as demonstrated in Figure 5.7.

    Figure 5.7: USB Control Transfers
    Image wiz_usb_rwpipe_ctr_custom_req

    When you select one of the available standard USB requests, the setup packet information for the selected request is automatically filled and the request description is displayed in the Request Description box.

    For a custom request, you are required to enter the setup packet information and write data (if exists) yourself. The size of the setup packet should be eight bytes and it should be defined using little endian byte ordering. The setup packet information should conform to the USB specification parameters (bmRequestType, bRequest, wValue, wIndex, wLength).

    ****************************************************************************************
      NOTE
      More detailed information on the standard USB requests, on how to implement the control transfer and how to send setup packets can be found in section 9.2.
    ****************************************************************************************

        iii.
    For an input pipe (moves data from device to host) click Listen to Pipe. To successfully accomplish this operation with devices other than HID, you need to first verify that the device sends data to the host. If no data is sent after listening for a short period of time, DriverWizard will notify you that the Transfer Failed.

    Figure 5.8: Listen to Pipe
    Image wiz_usb_pipe_in

    To stop reading, click Stop Listen to Pipe.

        iv.
    For an output pipe (moves data from host to device), click Write to Pipe. A new dialogue box will appear asking you to enter the data to write. The DriverWizard log will contain the result of the operation.

    Figure 5.9: Write to Pipe
    Image wiz_usb_pipe_out_write

        v.
    You can reset input and output pipes by pressing the Reset Pipe button for the selected pipe.

  7. Generate the skeletal driver code:

        (a)
    Select to generate code either via the Generate Code toolbar icon or from the Project | Generate Code menu.

        (b)
    In the Select Code Generation Options dialogue box that will appear, choose the code language and development environment(s) for the generated code and select Next to generate the code.

    Figure 5.10: Code Generation Options
    Image wiz_pci_gen_code

        (c)
    Save your project (if required) and click OK to open your development environment with the generated driver.

        (d)
    Close DriverWizard.

  8. Compile and run the generated code:


next up previous contents
Next: 5.3 DriverWizard Notes Up: 5. Using DriverWizard Previous: 5.1 An Overview   Contents