USB大容量存储BOT
+ -

BOT 设备描述符及布局

2021-09-26 2669 2

Bulk-Only Transport即存储设备和其它的普通设备类似,也有一些通用的描述符,如设备描述符配置描述符接口描述符端点描述符字符串描述符

BOT大容量存储设备没有其它特殊的描述符。

一个标准的USB支持BOT的大容量设备描述符布局如下:
BOT的大容量设备描述符布局

设备描述符

BOT大容量存储设备类型接口描述符中定义的,所以在其设备描述符中,bDeviceClass、bDeviceSubClass、bDeviceProtocol的值必须为0。

iSerialNumber字符串的定义需要按照相关的格式定义(windows验证不严格);这个格式是序列号的字符串最后12字符必须为十六进制的数据位。

如本人手中的金士顿U盘的设备描述符如下:

    ---------------------- Device Descriptor ----------------------
bLength                  : 0x12 (18 bytes)
bDescriptorType          : 0x01 (Device Descriptor)
bcdUSB                   : 0x200 (USB Version 2.00)
bDeviceClass             : 0x00 (defined by the interface descriptors)
bDeviceSubClass          : 0x00
bDeviceProtocol          : 0x00
bMaxPacketSize0          : 0x40 (64 bytes)
idVendor                 : 0x0951 (Kingston Technology Company)
idProduct                : 0x1665
bcdDevice                : 0x0200
iManufacturer            : 0x01 (String Descriptor 1)
 Language 0x0409         : "Kingston"
iProduct                 : 0x02 (String Descriptor 2)
 Language 0x0409         : "DataTraveler 2.0"
iSerialNumber            : 0x03 (String Descriptor 3)
 Language 0x0409         : "1C6F654E48EB1FC1391B7D69"
bNumConfigurations       : 0x01 (1 Configuration)
Data (HexDump)           : 12 01 00 02 00 00 00 40 51 09 65 16 00 02 01 02   .......@Q.e.....
                           03 01

配置描述符

配置描述符和标准的配置描述符保持一致。

    ------------------ Configuration Descriptor -------------------
bLength                  : 0x09 (9 bytes)
bDescriptorType          : 0x02 (Configuration Descriptor)
wTotalLength             : 0x0020 (32 bytes)
bNumInterfaces           : 0x01 (1 Interface)
bConfigurationValue      : 0x01 (Configuration 1)
iConfiguration           : 0x00 (No String Descriptor)
bmAttributes             : 0x80
 D7: Reserved, set 1     : 0x01
 D6: Self Powered        : 0x00 (no)
 D5: Remote Wakeup       : 0x00 (no)
 D4..0: Reserved, set 0  : 0x00
MaxPower                 : 0x32 (100 mA)
Data (HexDump)           : 09 02 20 00 01 01 00 80 32 09 04 00 00 02 08 06   .. .....2.......
                           50 00 07 05 81 02 00 02 00 07 05 02 02 00 02 00   P...............

接口描述符

BOT大容量存储设备类型定义在接口描述符中,所以
故需要按要求填写。

字段 说明
bInterfaceClass 0x08 MASS STORAGE Class
bInterfaceSubClass 0x06 表示SCSI命令集。
bInterfaceProtocol 0x50 BULK-ONLY TRANSPORT.

bInterfaceSubClass支持的命令集

bInterfaceSubClass支持的命令集

bInterfaceProtocol支持的协议

 bInterfaceProtocol支持的协议

        ---------------- Interface Descriptor -----------------
bLength                  : 0x09 (9 bytes)
bDescriptorType          : 0x04 (Interface Descriptor)
bInterfaceNumber         : 0x00
bAlternateSetting        : 0x00
bNumEndpoints            : 0x02 (2 Endpoints)
bInterfaceClass          : 0x08 (Mass Storage)
bInterfaceSubClass       : 0x06 (SCSI transparent command set)
bInterfaceProtocol       : 0x50 (Bulk-Only Transport)
iInterface               : 0x00 (No String Descriptor)
Data (HexDump)           : 09 04 00 00 02 08 06 50 00                        .......P.

端点描述符

端点描述符定义一对输入输出端点,端点类型为批量传输类型

        ----------------- Endpoint Descriptor -----------------
bLength                  : 0x07 (7 bytes)
bDescriptorType          : 0x05 (Endpoint Descriptor)
bEndpointAddress         : 0x81 (Direction=IN EndpointID=1)
bmAttributes             : 0x02 (TransferType=Bulk)
wMaxPacketSize           : 0x0200 (max 512 bytes)
bInterval                : 0x00 (never NAKs)
Data (HexDump)           : 07 05 81 02 00 02 00                              .......

        ----------------- Endpoint Descriptor -----------------
bLength                  : 0x07 (7 bytes)
bDescriptorType          : 0x05 (Endpoint Descriptor)
bEndpointAddress         : 0x02 (Direction=OUT EndpointID=2)
bmAttributes             : 0x02 (TransferType=Bulk)
wMaxPacketSize           : 0x0200 (max 512 bytes)
bInterval                : 0x00 (never NAKs)
Data (HexDump)           : 07 05 02 02 00 02 00

字符串描述符

字符串描述符除了设备序列号有特殊的要求外,其余可可自定义.

             ------ String Descriptor 0 ------
bLength                  : 0x04 (4 bytes)
bDescriptorType          : 0x03 (String Descriptor)
Language ID[0]           : 0x0409 (English - United States)
Data (HexDump)           : 04 03 09 04                                       ....
             ------ String Descriptor 1 ------
bLength                  : 0x12 (18 bytes)
bDescriptorType          : 0x03 (String Descriptor)
Language 0x0409          : "Kingston"
Data (HexDump)           : 12 03 4B 00 69 00 6E 00 67 00 73 00 74 00 6F 00   ..K.i.n.g.s.t.o.
                           6E 00                                             n.
             ------ String Descriptor 2 ------
bLength                  : 0x22 (34 bytes)
bDescriptorType          : 0x03 (String Descriptor)
Language 0x0409          : "DataTraveler 2.0"
Data (HexDump)           : 22 03 44 00 61 00 74 00 61 00 54 00 72 00 61 00   ".D.a.t.a.T.r.a.
                           76 00 65 00 6C 00 65 00 72 00 20 00 32 00 2E 00   v.e.l.e.r. .2...
                           30 00                                             0.
             ------ String Descriptor 3 ------
bLength                  : 0x32 (50 bytes)
bDescriptorType          : 0x03 (String Descriptor)
Language 0x0409          : "1C6F654E48EB1FC1391B7D69"
Data (HexDump)           : 32 03 31 00 43 00 36 00 46 00 36 00 35 00 34 00   2.1.C.6.F.6.5.4.
                           45 00 34 00 38 00 45 00 42 00 31 00 46 00 43 00   E.4.8.E.B.1.F.C.
                           31 00 33 00 39 00 31 00 42 00 37 00 44 00 36 00   1.3.9.1.B.7.D.6.
                           39 00
HID人机交互QQ群:564808376    UAC音频QQ群:218581009    UVC相机QQ群:331552032    BOT&UASP大容量存储QQ群:258159197    STC-USB单片机QQ群:315457461    USB技术交流QQ群2:580684376    USB技术交流QQ群:952873936   

0 篇笔记 写笔记

UVC 描述符及描述符布局
USB设备的描述符用于向主机报告其设备的属性信息,UVC设备属于USB设备的一种,故和通用的USB设备一样,也包含设备描述符、配置描述符、接口描述符、端点描述符和字符串描述符。UVC设备在也定义了一些特有的描述符,用于对USB视频设备的扩展。这些特有的UVC描述符和通用的USB描述符,共同组成了UV......
USB设备描述符布局
通用串行总线USB以其强大的功能,方便的连接广受用户使用,这些都得益于USB灵活多样的描述符。USB设备通过配置描述符,接口描述符,端点描述符等描述符实现设备功能。USB设备灵活多变的角色转换是通过USB的配置描述符来实现的,但一个USB设备有多个配置描述符时,就表明了这个USB设备支持多角的转换......
BOT 设备描述符及布局
Bulk-Only Transport即存储设备和其它的普通设备类似,也有一些通用的描述符,如设备描述符、配置描述符、接口描述符、端点描述符和字符串描述符。BOT大容量存储设备没有其它特殊的描述符。一个标准的USB支持BOT的大容量设备描述符布局如下:设备描述符BOT大容量存储设备类型是接......
关注公众号
取消
感谢您的支持,我会继续努力的!
扫码支持
扫码打赏,你说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

您的支持,是我们前进的动力!