none
How to make Automatically Device driver installation in Win 7/WIn 8 when using RNDIS in Windows Compact RRS feed

  • Question

  • We are developing a precision instrument that measures Temperature, Pressure and humidity used in the pharmaceutical industry.

    The Instrument is based on Windows Embedded Compact (7.0)

    WE establish a TCP communication vi a USB connection. This is done by the RNDIS Driver.

    When we connect the instrument to a PC we have to do the following in Windows:

    http://developer.toradex.com/knowledge-base/how-to-install-microsoft-rndis-driver-for-windows-7

    The INF that is used is then C:\Windows\inf\rndiscmp.inf

    We want this to be executed automatically

    The way it is automated is by setting the correct entry’s in the registration database on the Instruments. In Windows CE registration database.

    On http://www.usb.org/developers/defined_class we think we must set Base Class = EFh, SubClass = 04h and Protocol = 01h.

    But how is this done in the registry on the device?

    Who can help me :-)


    Monday, February 16, 2015 10:01 AM

Answers

  • Hi, I have done this. You have to change subclass ID in the RNDIS code to make it work. To achieve that, clone Microsoft RNDIS code and change USB_DEVICE_SUBCLASS_ACTIVESYNC entry from 0x01 to 0x04. Host PC will then automatically recognize device and install the driver - no action needed!
    • Marked as answer by Mads Siggaard Friday, February 20, 2015 4:48 PM
    Tuesday, February 17, 2015 7:23 AM
  • Hi Mads,

    changes in "rndisfn.h" in public folder have no influance on your project, because those files are not built at all. Visual Studio will use this one anyway (which is already built): C:\WINCE700\public\common\oak\target\armv7\retail\rndisfn.dll

    To make use of Microsoft public code, you have to clone this code - that is copy selected source files to BSP folder and adjust DIRS files to include new data in the compilation process.

    To clone RNDIS component, copy rndis folder from C:\WINCE700\public\common\oak\drivers\UsbFn\class to C:\WINCE700\platform\YOUR_BSP\Src\COMMON\USBFN.

    Edit source file C:\WINCE700\platform\YOUR_BSP\Src\COMMON\USBFN\rndis\rndisfn\sources:

    DOSYSGEN=1
    
    TARGETDEFNAME=RNDISFN
    
    TARGETNAME=RNDISFN
    TARGETTYPE=DYNLINK
    DLLENTRY=_DllEntryCRTStartup
    
    SOURCES= \
        rndisfn.cpp \
    
    TARGETLIBS= \
        $(_COMMONSDKROOT)\lib\$(_CPUINDPATH)\ndis.lib   \
        $(_COMMONOAKROOT)\lib\$(_CPUINDPATH)\ceddk.lib  \
        $(_SYSGENSDKROOT)\lib\$(_CPUINDPATH)\coredll.lib
    
    SOURCELIBS=\
        $(SG_OUTPUT_ROOT)\platform\$(_TGTPLAT)\lib\$(_CPUINDPATH)\rndismini2.lib \
        $(_PUBLICROOT)\common\oak\lib\$(_CPUINDPATH)\ufnclientlib.lib

    Finally, edit C:\WINCE700\platform\YOUR_BSP\Src\COMMON\USBFN\dirs to include your new component (folder) in the build process:

    DIRS=\
        RNDISKITL \
        RNDIS \
    System will build now new rndisfn.dll, which will replace the original one in the public directory. I hope I didn't forget anything...
    • Edited by mariuszjg Tuesday, February 24, 2015 1:34 PM
    • Marked as answer by Mads Siggaard Friday, February 27, 2015 10:11 AM
    Tuesday, February 24, 2015 1:33 PM

All replies

  • Huh?  I am going to take a guess at what you are asking.   It seems that most of what you typed has nothing to do with Windows Compact 7 or your device - if I am wrong, let me know.

    I believe that the only two things that are about your device are:

    1. The device is running Windows Embedded Compact 7
    2. You want to connect to a PC via USB RNDIS

    What I can't figure out is if the device and the instrument are the same thing, are they?

    Then, you want to do something on the device, which I think is set up registry data to load the RNDIS driver, but I am not sure.  If that is the case, then you may need to discuss this with your vendor.   I have a registry editor on my blog that you can use, see http://geekswithblogs.net/BruceEitman/archive/2009/07/27/window-ce-simple-little-registry-editor.aspx


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

    Monday, February 16, 2015 1:56 PM
    Moderator
  • Hi, I have done this. You have to change subclass ID in the RNDIS code to make it work. To achieve that, clone Microsoft RNDIS code and change USB_DEVICE_SUBCLASS_ACTIVESYNC entry from 0x01 to 0x04. Host PC will then automatically recognize device and install the driver - no action needed!
    • Marked as answer by Mads Siggaard Friday, February 20, 2015 4:48 PM
    Tuesday, February 17, 2015 7:23 AM
  • Hi Mariuszjg

    Thankyou very much for u help. I am really greatfull

    We will try test this in the weekend.

    I like to connect to you in Linked In. Can you give me details

    Mads

    Friday, February 20, 2015 4:37 PM
  • Thx for reacting to my post

    Yes the device and the Instrument are the same thing.

    Then the issue is to have windows 7/8 automatically detecting the device so the user dont have to manually

    attach the RNDIS driver in the device manager.

    This is achived by setting up the registry in the device.

    I think Mariuszjg have solved the issue. he actually did this little secret trick.

    I have called in the programmers for this sunday to test :-)

    Friday, February 20, 2015 4:47 PM
  • Hi, I have done this. You have to change subclass ID in the RNDIS code to make it work. To achieve that, clone Microsoft RNDIS code and change USB_DEVICE_SUBCLASS_ACTIVESYNC entry from 0x01 to 0x04. Host PC will then automatically recognize device and install the driver - no action needed!

    Dear Mariuszjg

    What do you mean when you say "Clone Microsoft RNDIS code". You mean the header file rndisfn.h ?

    We are replacing this line in the header file

    #define USB_DEVICE_SUBCLASS_ACTIVESYNC  0x01

    with this one

    #define USB_DEVICE_SUBCLASS_ACTIVESYNC  0x04

    But the WIN CE OS is not reacting on this change. How should we build the kernel/OS ?

    Tuesday, February 24, 2015 8:49 AM
  • Hi Mads,

    changes in "rndisfn.h" in public folder have no influance on your project, because those files are not built at all. Visual Studio will use this one anyway (which is already built): C:\WINCE700\public\common\oak\target\armv7\retail\rndisfn.dll

    To make use of Microsoft public code, you have to clone this code - that is copy selected source files to BSP folder and adjust DIRS files to include new data in the compilation process.

    To clone RNDIS component, copy rndis folder from C:\WINCE700\public\common\oak\drivers\UsbFn\class to C:\WINCE700\platform\YOUR_BSP\Src\COMMON\USBFN.

    Edit source file C:\WINCE700\platform\YOUR_BSP\Src\COMMON\USBFN\rndis\rndisfn\sources:

    DOSYSGEN=1
    
    TARGETDEFNAME=RNDISFN
    
    TARGETNAME=RNDISFN
    TARGETTYPE=DYNLINK
    DLLENTRY=_DllEntryCRTStartup
    
    SOURCES= \
        rndisfn.cpp \
    
    TARGETLIBS= \
        $(_COMMONSDKROOT)\lib\$(_CPUINDPATH)\ndis.lib   \
        $(_COMMONOAKROOT)\lib\$(_CPUINDPATH)\ceddk.lib  \
        $(_SYSGENSDKROOT)\lib\$(_CPUINDPATH)\coredll.lib
    
    SOURCELIBS=\
        $(SG_OUTPUT_ROOT)\platform\$(_TGTPLAT)\lib\$(_CPUINDPATH)\rndismini2.lib \
        $(_PUBLICROOT)\common\oak\lib\$(_CPUINDPATH)\ufnclientlib.lib

    Finally, edit C:\WINCE700\platform\YOUR_BSP\Src\COMMON\USBFN\dirs to include your new component (folder) in the build process:

    DIRS=\
        RNDISKITL \
        RNDIS \
    System will build now new rndisfn.dll, which will replace the original one in the public directory. I hope I didn't forget anything...
    • Edited by mariuszjg Tuesday, February 24, 2015 1:34 PM
    • Marked as answer by Mads Siggaard Friday, February 27, 2015 10:11 AM
    Tuesday, February 24, 2015 1:33 PM