none
CE6 USB Composite ActiveSync & Mass_Storage RRS feed

  • Question

  • Hi,

    I have a problem with exposing my CE6 device as a Serial_Class and Mass_Storage_Class USB Composite device.

    Here are my registry entries:

    [HKEY_LOCAL_MACHINE\Drivers\USB\FunctionDrivers]
       "DefaultClientDriver"="CompositeFN"
       
    [HKEY_LOCAL_MACHINE\Drivers\USB\FunctionDrivers\CompositeFN]
        "Attributes"=multi_sz:"0x80"
        "ClientDriverList"=multi_sz:"Serial_Class","Mass_Storage_Class"
        "DefaultPrefix"="CompositeFn_"
        "ManufacturerString"="Test"
        "ProductString"="Composite Device"
        "MaxPacketSize"=dword:40
        "ProductID"=dword:0001
        "VendorID"=dword:0123
        "PowerConsumption"=multi_sz:"0x00"
        
    [HKEY_LOCAL_MACHINE\Drivers\USB\FunctionDrivers\Serial_Class]
        "CompositeFn_Configurations"=multi_sz:"0x00"
        "CompositeFn_DefaultString"="USB ActiveSync"
        "CompositeFn_FunctionDescription"="USB ActiveSync Driver"
        "CompositeFn_FunctionClass"=dword:0a
        "CompositeFn_FunctionSubclass"=dword:00
        "CompositeFn_FunctionProtocol"=dword:ff
        "CompositeFn_Disable"=dword:0
        "Manufacturer"="Test"
        "Product"="TestP"
        "SerialNumber"="00000000"
        "DeviceName"="Test"

    [HKEY_LOCAL_MACHINE\Drivers\USB\FunctionDrivers\Mass_Storage_Class]
    "CompositeFn_Configurations"=multi_sz:"0x00"
    "CompositeFn_DefaultString"="USB Mass Storage"
    "CompositeFn_FunctionClass"=dword:08
    "CompositeFn_FunctionProtocol"=dword:ff
    "CompositeFn_FunctionSubclass"=dword:00
    "CompositeFn_FunctionDescription"="USB MassStorage"
    "CompositeFn_Disable"=dword:0
        "InterfaceSubClass"=dword:06 
        "InterfaceProtocol"=dword:50 
    "DeviceName"="SD" 

    In order to get ActiveSync to work, I added the VID/PID in wceusbsh.inf. The problem is that only the first function is actually working. For example if I have this:

     "ClientDriverList"=multi_sz:"Serial_Class","Mass_Storage_Class"

    ActiveSync is working, Mobile Device Center is starting after connecting the USB cable but the Mass_Storage function fails to work. I get some errors in bot.cpp (Malformed MAX LUN). It seams that in this case the interface index for the Mass_Storage function is 1 and bot.cpp is written to filter for index 0. Even if I modify the BOT code and change the interface index to 1 it still fails with other messages so my guess is that something is wrong before the BOT code gets loaded....

    If I have it the other way:

     "ClientDriverList"=multi_sz:"Mass_Storage_Class","Serial_Class"

    The Mass_Storage function is working OK, the driver for Active Sync is installed but Mobile Device Center does not start anymore when I connect the cable.

    Is my registry configuration bad ? Can someone help me with this ?

    Thanks,

    Dragan

    Monday, August 5, 2013 3:15 PM

Answers

  • Found the problem.... It seams that the BSP I am using  (provided free by Freescale for MX28) had a bug in the USB PDD. It defined a maximum of 5 endpoints although the MX28 supports 8 endpoints.

    So if we do the math we have 2 endpoints for MS + 3 for Serial_Class + 1 EP0 = 6 endpoints. Because of this, the second function did not work as its last endpoint could not be created (also thought that Serial Class had only 2 endpoints).

    The strange thing is that when I built the platform in debug mode, the usb driver failed to load without a very explicit error info. I just assumed that this was a different problem since in release it did load, and did not investigate further.

    Thank you both for replying!

    Dragan

    • Marked as answer by dragan_s Thursday, September 12, 2013 8:48 AM
    Thursday, September 12, 2013 8:48 AM

All replies

  • Are you sure you've installed the drivers correctly?

    Using "ClientDriverList"=multi_sz:"Mass_Storage_Class","Serial_Class" as the example will mean adding a VID/PID entry with the Mi field set:

    USB\VID_1234&PID_4321&Mi_00 for the 1st item in the composite driver (Mass_Storage_Class), and

    USB\VID_1234&PID_4321&Mi_01 for the 2nd item (Serial_Class)

    Registry looks ok for activesync/composite, but I don't use mass storage.

    Cheers,

    Barak

    Tuesday, August 6, 2013 12:01 AM
  • this blog may show some lights on it

    http://www.e-consystems.com/blog/windowsce/?p=465


    Please mark as answer, if it is correct.
    Please vote,if it is helpful post.
    All the Best
    Vinoth.R
    www.e-consystems.com
    http://vinoth-vinothblog.blogspot.com

    Tuesday, August 6, 2013 5:46 AM
  • Hi Barak,

    I'm not sure if the drivers are installed correctly... I did add the VID/PID and MI_01 in wceusbsh.inf and the driver is installed without problems (apart from the "this driver is not digitally signed" message). However it seams that Windows Mobile Device Center does not detect the device if the "Serial_Class" is on interface MI_01.

    For the Mass_Storage_Class, I tried to add the VID/PID/MI in usbstor.inf but it seams that windows is not using it... However, the Mass_Storage_Class is working ok if it is on MI_01 without adding any VID/PID/MI entries.

    Did you ever use Serial_Class in a composite device on MI_01 (or other than MI_00) ?

    I also can confirm that in this configuration (Mass_Storage on MI_00 and Serial on MI_01) repllog.exe is started on the device so I think that there is something on the PC side.

    I must be missing something that is obvious :).

    Wednesday, August 7, 2013 12:17 PM
  • Found the problem.... It seams that the BSP I am using  (provided free by Freescale for MX28) had a bug in the USB PDD. It defined a maximum of 5 endpoints although the MX28 supports 8 endpoints.

    So if we do the math we have 2 endpoints for MS + 3 for Serial_Class + 1 EP0 = 6 endpoints. Because of this, the second function did not work as its last endpoint could not be created (also thought that Serial Class had only 2 endpoints).

    The strange thing is that when I built the platform in debug mode, the usb driver failed to load without a very explicit error info. I just assumed that this was a different problem since in release it did load, and did not investigate further.

    Thank you both for replying!

    Dragan

    • Marked as answer by dragan_s Thursday, September 12, 2013 8:48 AM
    Thursday, September 12, 2013 8:48 AM