USB Mass Storage Device on VF61 / WEC 2013

We’re having some issues getting USB mass storage to work. The registry is configured according to High performance, low power Embedded Computing Systems | Toradex Developer Center, but when connected to a PC, the USB enumeration fails - it seems like the USB device descriptor can’t be retrieved. The module should be acting as a USB client, and the device we’re trying to expose is a Ramdisk that otherwise works perfectly.

I’ve checked the Microsoft documentation but didn’t find any smoking gun.

Are there any further configurations steps required? Is it necessary to change the USB VID/PID, or any of the device class settings?

Cheers,

Garry

Is the device not detected at all or you get an error on the PC side? Can you report the state of your device in device manager after connection (if any)?
If device is not detected at all it may be an issue with the OTG driver. The controller can behave as host or as client and the OTG driver switches between those states using pin 137.
You can force the device to work only in client mode using the registry, as described here (I just updated the docs, information was not there if you searched in KB yesterday, sorry for this):
https://developer.toradex.com/knowledge-base/usb-on-the-go
You should also pull down pin 137 because it’s directly connected to the VBUS detect pin on the SOC and this may lead to issues.

Thanks for the tip - pin 137 was being pulled up when the cable was plugged in. In this condition, on the PC side, the error (obtained via UsbView) was DeviceFailedEnumeration: Unknown USB Device (Device Descriptor Request Failed). The device descriptor request was repeated infinitely, which I’m guessing was due to the SoC also being in host mode.

After some resoldering to pull pin 137 low, there’s no detection at all on the PC side.

USB OTG settings are:

[HKEY_LOCAL_MACHINE\Drivers\BuiltIn\USBOTG]
"Dll"="otg_vybrid.dll"
"IClass"=hex:7b,41,33,32,39,34,32,42,37,2d,39,32,30,43,2d,34,38,36,62,2d,42,30,\
  45,36,2d,39,32,41,37,30,32,41,39,39,42,33,35,7d,00,00
"Priority256"=dword:00000064
"HCDPortNumberOnOTG"=dword:00000001
"DisableRoleSwitch"=dword:00000000
"InitialRoleMaster"=dword:00000001
"DynamicClientLoad"=dword:00000003
"Order"=dword:00000020
"Index"=dword:00000000
"Prefix"="OTG"

[HKEY_LOCAL_MACHINE\Drivers\BuiltIn\USBOTG\UsbFn]
"OTGSupport"=dword:00000000
"IClass"=hex(7):7b,00,45,00,32,00,42,00,44,00,43,00,33,00,37,00,32,00,2d,00,35,\
  00,39,00,38,00,46,00,2d,00,34,00,36,00,31,00,39,00,2d,00,42,00,43,00,35,00,\
  30,00,2d,00,35,00,34,00,42,00,33,00,46,00,37,00,38,00,34,00,38,00,44,00,33,\
  00,35,00,7d,00,3d,00,25,00,62,00,00,00,7b,00,36,00,46,00,34,00,30,00,37,00,\
  39,00,31,00,44,00,2d,00,33,00,30,00,30,00,45,00,2d,00,34,00,34,00,45,00,34,\
  00,2d,00,42,00,43,00,33,00,38,00,2d,00,45,00,30,00,45,00,36,00,33,00,43,00,\
  41,00,38,00,33,00,37,00,35,00,43,00,7d,00,3d,00,25,00,62,00,00,00,00,00
"BusIoctl"=dword:002a0048
"OTGGroup"="01"
"Priority256"=dword:00000064
"Irq"=dword:0000006b
"MemLen"=dword:00001000
"MemBase"=dword:40034000
"Order"=dword:00000002
"Index"=dword:00000001
"Dll"="usbfn.dll"
"Prefix"="UFN"

and function driver settings are:

[HKEY_LOCAL_MACHINE\Drivers\USB\FunctionDrivers]
"DefaultClientDriver"="Mass_Storage_Class"

[HKEY_LOCAL_MACHINE\Drivers\USB\FunctionDrivers\Mass_Storage_Class]
"DeviceName"="RAMDisk"
"idProduct"=dword:0000ffff
"bcdDevice"=dword:00000000
"Product"="Generic Mass Storage (PROTOTYPE--Remember to change idVendor)"
"Manufacturer"="Generic Manufacturer (PROTOTYPE--Remember to change idVendor)"
"idVendor"=dword:0000045e
"FriendlyName"="Mass Storage"
"InterfaceProtocol"=dword:00000050
"InterfaceSubClass"=dword:00000006
"Dll"="usbmsfn.dll"

Any ideas?

Also, just to clarify: we can’t use the registry to force client-only mode, as the device is also required to work in host mode. For now, though, we’re just interested in getting client mode working.

Ok, so you can keep the pin connected.
On PC you can see an USB device with vid/pid?
Are you testing with your own carrier board? Can you test with the EVB?