none
How to load custom USB HID driver on Windows CE? RRS feed

  • Question

  • Hi

    I've built my own USB HID driver for my Atmel microcontroller (AT90USB162 that acts just as an HID device)

    And I've added that to my WinCE Image

    But I cant load the driver correctly!

    The device's VID = 1003, and PID = 8211

    I just added these registry keys to Common.reg:

       

    [HKEY_LOCAL_MACHINE\Drivers\USB\LoadClients\1003_8211\Default\3\MyHID]
      "DLL"="MyHID.DLL"

    [HKEY_LOCAL_MACHINE\Drivers\USB\LoadClients\1003_8211\Default\255\MyHID]
      "DLL"="MyHID.DLL"

    [HKEY_LOCAL_MACHINE\Drivers\USB\ClientDrivers\MyHID]
      "DLL"="MyHID.DLL"
      "Prefix"="MHD"

    What am I missing?

    Wednesday, September 9, 2015 12:00 PM

All replies

  • Whether VID and PID you have given above are hex values? I mean, 0x1003 and 0x8211 ?

    If so, try using decimal values in <vid>_<pid> place. I mean:

    [HKEY_LOCAL_MACHINE\Drivers\USB\LoadClients\4099_33297\Default\Default\MyHID]
          "DLL"="MyHID.DLL"


    And, don't modify common.reg . Use platform.reg instead.


    Keshava G N, Software Engineer, iWave Systems, Bangalore ( http://iwavesystems.com ). mail - keshavagnATiwavesystemsDOTcom , blog - http://wec7.blogspot.com ,

    Wednesday, September 9, 2015 12:22 PM
  • Thanks for your reply GNKeshava

    But it did not work!

    The driver just does not activate!

    Sunday, September 13, 2015 5:57 AM
  • Are you getting "Unidentified USB device" dialog box ?

    Keshava G N, Software Engineer, iWave Systems, Bangalore ( http://iwavesystems.com ). mail - keshavagnATiwavesystemsDOTcom , blog - http://wec7.blogspot.com ,

    Monday, September 14, 2015 4:11 AM
  • Hi Keshava

    No, There is no dialog box

    Sunday, September 20, 2015 6:07 AM
  • Hi Keshava

    No, There is no dialog box

    So your problem is not related to one similar in this thread?

    That means it is getting proper dll from registry.

    How did you say that driver is not loaded? Did you use kernel debugger/KITL ?


    Keshava G N, Software Engineer, iWave Systems, Bangalore ( http://iwavesystems.com ). mail - keshavagnATiwavesystemsDOTcom , blog - http://wec7.blogspot.com ,

    Monday, September 21, 2015 3:37 AM
  • How did you say that driver is not loaded? Did you use kernel debugger/KITL ?

    But it does not go to Active Subkey of Registry!

    and I have written some "WRTIE TO FILE" codes in driver's entry points, but there is no file written!

    Monday, September 21, 2015 5:10 AM
  • Check to see if you have the dialog disabled in the registry.  If you have:

    [HKEY_LOCAL_MACHINE\Drivers\USB\LoadClients]
          "DoNotPromptUser"=dword:1

    it would explain why the dialog doesn't show.  Change it to zero, and test again.

    If that isn't why the dialog doesn't show, then it must be that you have another driver which does load for when you plug in your USB device (this is based on you saying that your other debug methods are valid and are not showing that the driver is loading.)

    You may want to debug the USB Host drivers bus enumeration and driver loading.  It will tell you exactly what is going on and why your driver isn't loading.



    Bruce Eitman (eMVP)
    Senior Engineer
    Bruce.Eitman AT Eurotech DOT com
    My BLOG http://geekswithblogs.net/bruceeitman
    I work for Eurotech

    Monday, September 21, 2015 1:58 PM
    Moderator
  • You may want to debug the USB Host drivers bus enumeration and driver loading.  It will tell you exactly what is going on and why your driver isn't loading.



    Hi Bruce

    Can you tell me how to do this DEBUGGING? (Do you mean this: making debug version of OS, and see DEBUGMSGs, or add RETAILMSGs to the code?)

    And, maybe, by default, the publuc HID driver (USBHID.dll) is being loaded for my device. if so, how to prevent the public driver from loading?




    • Edited by S_Javani Wednesday, September 23, 2015 6:28 AM
    Wednesday, September 23, 2015 6:13 AM
  • You should check the registry settings for :

    1. Client device to be detected as mentioned by Keshava.

    2. Check if the registery is set, not to prompt user when client driver is loaded as suggested by Bruce

    Additionally, you can check if your driver is getting loaded for that may be debugging the driver is essential using debug prints or using breakpoints (debug built and debugger enabled)

    You may built the image for the in debug mode and test is another way.

    --- Misbah

    --- 


    Senior Design Engineer T.E.S Electroni Solutions (Bangalore-India) www.tes-dst.com email-misbah.khan@tes-dst.com

    Wednesday, September 23, 2015 11:12 AM
  • And, maybe, by default, the publuc HID driver (USBHID.dll) is being loaded for my device. if so, how to prevent the public driver from loading?

    Remove the driver, or its registry settings, from your OS.

    As far as how to debug, that is too big a topic for me to work on in a forum.



    Bruce Eitman (eMVP)
    Senior Engineer
    Bruce.Eitman AT Eurotech DOT com
    My BLOG http://geekswithblogs.net/bruceeitman
    I work for Eurotech

    Wednesday, September 23, 2015 12:43 PM
    Moderator