USB Mass Storage Bulk only driver - Page 1
Forum section: electronics / general

author: Aggressive_Doughnut
author_rank: Contributor
timestamp: February 12, 2021, 03:02:40 pm
content: Hey all. I'm whipping up my first USB BBB (I guess BOT now) device, and I thought I got the descriptors correct, but Windows 10 is saying no driver even though I see the device in Device Manager. I have other BBB devices that Just Work™ with the generic driver, so I must have gotten something wrong somewhere... I have Vendor/Product as 0x00, but I have Manufacturer/Product string descriptors, could these screw with it? But even when I uninstall the device, remove the string descriptors and let it reinstall, I get an unknown device with no driver assignment. They didn't have a negative effect on my HID devices, but maybe for mass storage?Also there is no Device Description property in the device properties, so maybe there is something wrong in the descriptors that I'm not seeing? I have gone through line by line with the spec, but I'm not seeing it.Here are my descriptors:Code:/** Device descriptor */#define USBD_DEVICE_DESCRIPTOR \0x12, /* bLength | size of descriptor */\0x01, /* bDescriptorType | descriptor type */\0x00, 0x02, /* bcdUSB | USB spec release (ver 2.0) */\0x00, /* bDeviceClass class code (each interface specifies class information) */\0x00, /* bDeviceSubClass device sub-class */\0x00, /* bDeviceProtocol | device protocol (no class specific protocol) */\0x40, /* bMaxPacketSize0 | maximum packet size (64 bytes) */\0x00, 0x00, /* vendor ID (0x0000 None) */\0x00, 0x00, /* product ID (0x0000 None) */\0x01, 0x00, /* bcdDevice | final device release number in BCD Format */\USBD_STRING_MANUFACTURER_IX, /* iManufacturer | index of manufacturer string */\USBD_STRING_PRODUCT_IX, /* iProduct | index of product string */\USBD_STRING_SERIAL_IX, /* iSerialNumber | Serial Number string */\0x01 /* bNumConfigurations | number of configurations *//** Configuration descriptor */#define DEVICE_SELF_POWERED 1#define REMOTE_WU 1#define USBD_CONFIG_DESCRIPTOR_SIZE 9#define USBD_CONFIG_DESCRIPTOR_FULL_SIZE (USBD_CONFIG_DESCRIPTOR_SIZE + USBD_INTERFACE0_DESCRIPTOR_SIZE + USBD_ENDPOINT1_DESCRIPTOR_SIZE)#define USBD_CONFIG_DESCRIPTOR \0x09, /* bLength | length of descriptor */\0x02, /* bDescriptorType | descriptor type (CONFIGURATION) */\USBD_CONFIG_DESCRIPTOR_FULL_SIZE, 0x00, /* wTotalLength | total length of descriptor(s) */\0x01, /* bNumInterfaces */\0x01, /* bConfigurationValue */\0x00, /* index of string Configuration | configuration string index */\0x80 | (((DEVICE_SELF_POWERED) ? 1U:0U)<<6) | (((REMOTE_WU) ? 1U:0U)<<5), /* bmAttributes */\50 /* maximum power in steps of 2mA (100mA) */#define USBD_INTERFACE0_DESCRIPTOR_SIZE 9#define USBD_INTERFACE0_DESCRIPTOR \0x09, /* bLength */\0x04, /* bDescriptorType | descriptor type (INTERFACE) */\0x00, /* bInterfaceNumber */\0x00, /* bAlternateSetting */\0x01, /* bNumEndpoints | number of endpoints (1) */\0x08, /* bInterfaceClass | interface class (USB spec: Mass Storage, Bulk Only) */\0x00, /* bInterfaceSubClass |interface sub-class (0.. no boot interface) */\0x50, /* bInterfaceProtocol | interface protocol (USB spec: Mass Storage, Bulk Only) */\0x00 /* interface string index */#define USBD_ENDPOINT1_DESCRIPTOR_SIZE 7#define USBD_ENDPOINT1_DESCRIPTOR \0x07, /* bLength | length of descriptor (7 bytes) */\0x05, /* bDescriptorType | descriptor type (ENDPOINT) */\0x01, /* bEndpointAddress | endpoint address (OUT endpoint, endpoint 1) */\0x02, /* bmAttributes | endpoint attributes */\0x40, 0x00, /* bMaxPacketSizeLowByte, bMaxPacketSizeHighByte | maximum packet size (64 bytes) */\0x00 /* bInterval | polling interval (NA) */I should add that I can see the host sending the GetDescriptor, but then I never see a SetConfig, which I would see for HID devices. Is this typical of Mass Storage?

author: mon2
author_rank: Frequent Contributor
timestamp: February 12, 2021, 05:56:38 pm
content: Confirm your descriptors / structure with the following (free) tool:https://www.thesycon.de/eng/usb_descriptordumper.shtml

author: Aggressive_Doughnut
author_rank: Contributor
timestamp: February 12, 2021, 07:51:38 pm
content: The problem turned out to be the Interface Subclass Code (bInterfaceSubClass). I had it set to 0x00, but for BBB devices it's 0x06. Well, that and I only had an out endpoint, but that wasn't really a problem so much - I was waiting for driver recognition before adding it on.