USB device: Switch between "mass storage" and "serial class"

  • By default the USB device interface of all boards is configured to run active sync (serial). If you intend to access the board as regular mass storage device you can arrange this by simple changing a registry value.


    Mass Storage Device

    Code
    1. [HKEY_LOCAL_MACHINE\Drivers\USB\FunctionDrivers]
    2. "DefaultClientDriver"="Mass_Storage_Class"


    Active Sync

    Code
    1. [HKEY_LOCAL_MACHINE\Drivers\USB\FunctionDrivers]
    2. "DefaultClientDriver"="Serial_Class"

    Software developer, F&S Elektronik Systeme GmbH
    As this is an international forum, please try to post in English.
    Da dies ein internationales Forum ist, bitten wir darum, Beiträge möglichst in Englisch zu verfassen.

  • Hello,


    is it possible to change the the usb device client during runtime?


    I read something about DeviceIoControl and IOCTL_UFN_CHANGE_CURRENT_CLIENT but when I try to use this,
    the board reboots automatically...


    Another question:
    When I use Mass_Storage_Device_Class, the PicoMOD is recognized on a connected PC when I plug in a SD card to the PicoMOD and then the PC shows the contents of the SD card. Is it also possible that I show the contents of FFSDISK?

  • Hello,


    thanks for the inforamtion above. The used mass storeage is selected by:

    Code
    1. [HKEY_LOCAL_MACHINE\Drivers\USB\FunctionDrivers\Mass_Storage_Class]
    2. "DeviceName"="DSK1:"


    Try to find the "Devicename" of ffsdisk by "storage manger" (control panel/registry) or storage manger API.

    F&S Elektronik Systeme GmbH
    As this is an international forum, please try to post in English.
    Da dies ein internationales Forum ist, bitten wir darum, Beiträge möglichst in Englisch zu verfassen.

  • Hello,


    Code
    1. Do you know if changing the functiondriver on the fly (without) reboot is possible on the PicoMOD boards?

    Hm, i thought you test this "link" already. I did not test it until now.


    You may also test "DeactivateDevice(..."UFN1":...) -> configure Registry -> ActivateDevice(..."UFN1":...).

    F&S Elektronik Systeme GmbH
    As this is an international forum, please try to post in English.
    Da dies ein internationales Forum ist, bitten wir darum, Beiträge möglichst in Englisch zu verfassen.

  • Hi,


    as I wrote above, I tried the link but the PicoMOD always performs a reboot.


    I also tested your suggestion (DeactivateDevice -> ActivateDevice) but with the same result.
    After I call DeactivateDevice, the PicoMOD performs a reboot.

  • Sorry,
    i thought the your "post with the link" is the "solution for the previous post". The reboot may occur because the IO controls are not implemented. But i have no idea why "DeactivateDevice" fails. Any details?

    F&S Elektronik Systeme GmbH
    As this is an international forum, please try to post in English.
    Da dies ein internationales Forum ist, bitten wir darum, Beiträge möglichst in Englisch zu verfassen.

  • Here is my code (C#):



    The reboot occurs in the last code line. I also compared pdi.hDevice with the Hnd Registry entry under HKLM\Drivers\Active both are the same.

  • Hello,


    Quote

    I also compared pdi.hDevice with the Hnd Registry entry under HKLM\Drivers\Active both are the same.

    So everything seems to be right.


    Quote

    The reboot occurs in the last code line.

    Do you see any "reboot reason" in the debug output after reboot? From where do you know that the reboot occur in the last line? Do you debug vai Ethernet:-)?

    F&S Elektronik Systeme GmbH
    As this is an international forum, please try to post in English.
    Da dies ein internationales Forum ist, bitten wir darum, Beiträge möglichst in Englisch zu verfassen.