none
WinCE 6.0 USB Device Driver RRS feed

  • Question

  • Hi,

    I am new to USB drivers. I am writing WinCE USB Device Driver to handle Bulk transfers ( My WinCE IMX51 EVK board should act as a USB Device and connect with USB Host). I am using OTG available on EVK. After refferring Microsoft documentation, I got to know that I need to write USB Function clilent driver. Below I presented my approach. Is it correct approach or is there any better approach?

    1. Implement USB Stream Interface driver. It loads at builtin time. Say its prefix "UND:". As I am porting WinCE 5.0 driver to WinCE 6.0 I should retain previous stream Interface Driver.

    2. In Init do below steps. I reffered USB RNDIS Function driver for below steps.
      
     // Setup the MDD/PDD interface structures
        g_mddInterface.dwVersion = 1;
        g_mddInterface.pfnNotify = HandlePDDNotification;
        memset( &g_pddInterface, 0, sizeof(g_pddInterface) );
        g_pddInterface.dwVersion = 1;

        // Initialize our internal receive buffer markers
        g_RecvBufferHead = g_RecvBufferTail = 0;
     
     if( UfnPdd_Init( NULL, (PVOID)0xdeadbeef, &g_mddInterface, &g_pddInterface ) != ERROR_SUCCESS )
        {
            OALMSG(OAL_ERROR, (L"UfnPdd_Init failed!"));
            return FALSE;
        }

        HandleUSBDeviceRegistration();

         // Setup complete, Attach device to USB bus
        g_pddInterface.pfnStart( g_pddInterface.pvPddContext );

    3.  Using UND_Write and UND_Read do IO operations.


    Regards,
    Kiran


    kiran reddy
    Wednesday, May 11, 2011 4:35 AM

All replies

  • Hi Kiran Reddy,

    If I understood correctly you are planning to write a USB Function Driver.

    The terminology that you have used looks confusing for me.

    Please refer the following URL for the USB Terminology http://geekswithblogs.net/BruceEitman/archive/2009/04/08/windows-ce-usb-basics.aspx

    So, when you connect your target device to the Host PC, how you want it to be appear on Host PC ? (As a MSD, As Network Port or a Serial(You can use Active Sync application on Host PC)).

    If you want to write a custom client driver then you can clone the MSD Client Driver related the USB Fucntion Controller and modify it for your needs.

    Thank You & Regards,

    GSR

    Friday, May 13, 2011 4:29 AM
  • Hi GSR,

    Thanks for the reply. Sorry for the confusion.

    Yes I am writing Custom USB Function Client Driver.

    I am not exactly connecting with PC. I am going to connect with proprietary USB Host .I need to perform bulk transfers. I am planning to clone USB Printer Function driver. path: C:\WINCE600\PUBLIC\COMMON\OAK\DRIVERS\USBFN\CLASS\UFNPRN.

    Is it correct approach?

    Regards,
    Kiran

     

     

     


    kiran reddy
    Friday, May 13, 2011 4:54 AM
  • Hi Kiran Reddy,

    If you are planning to write a Custom USB Function Client Driver then do you have a valid VID and PID values for the same. Refer usb.org for more information.

    Looks the USB Printer driver is written in CPP. If you are pretty much familiar with that then you can go ahead clone it into your bsp directory and you can use it.

    I have cloned and used the USBFN\CLASS\STORAGE profile for clonning it. Because the Storage Profile just uses two Bulk Endpoints (in and out).

    Thank You & Regards,

    GSR

    Friday, May 13, 2011 8:32 AM
  • HI GSR,

    Thank you very much. VID and PID we have. I was in a confusion from where to start. Now it is clear.

    Regards,


    kiran reddy
    Friday, May 13, 2011 10:21 AM