USB2.0规范
+ -

USB 设备同时支持全速模式与高速模式

2021-11-23 2114 1

当一个USB高速设备接入全速的HUB时,这时会出现高速模式协商失败,这时为了设备能正常使用,会自动使用全速模式来运行。
所以为了同时支持全速高速的设备,必须有Device Qualifier Descriptor和其它速率配置描述符(OTHER_SPEED_CONFIGURATION),用于描述全速模式下的配置信息。这些配置信息主要包括接口描述符端点描述符

如一个同时支持全速与高速的USB存储设备其配置描述符大概是这样的:
支持全速与高速的USB存储设备

如本人手中的一块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...............

//高速模式
        ---------------- 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                              .......

    ----------------- Device Qualifier Descriptor -----------------
bLength                  : 0x0A (10 bytes)
bDescriptorType          : 0x06 (Device_qualifier Descriptor)
bcdUSB                   : 0x200 (USB Version 2.00)
bDeviceClass             : 0x00 (defined by the interface descriptors)
bDeviceSubClass          : 0x00
bDeviceProtocol          : 0x00
bMaxPacketSize0          : 0x40 (64 Bytes)
bNumConfigurations       : 0x01 (1 other-speed configuration)
bReserved                : 0x00
Data (HexDump)           : 0A 06 00 02 00 00 00 40 01 00                     .......@..

    ------------ Other Speed Configuration Descriptor -------------
bLength                  : 0x09 (9 bytes)
bDescriptorType          : 0x07 (Other_speed_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 07 20 00 01 01 00 80 32 09 04 00 00 02 08 06   .. .....2.......
                           50 00 07 05 81 02 40 00 00 07 05 02 02 40 00 00   P.....@......@..

//全速模式
        ---------------- 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           : 0x0040 (max 64 bytes)
bInterval                : 0x00 (never NAKs)
Data (HexDump)           : 07 05 81 02 40 00 00                              ....@..

        ----------------- Endpoint Descriptor -----------------
bLength                  : 0x07 (7 bytes)
bDescriptorType          : 0x05 (Endpoint Descriptor)
bEndpointAddress         : 0x02 (Direction=OUT EndpointID=2)
bmAttributes             : 0x02 (TransferType=Bulk)
wMaxPacketSize           : 0x0040 (max 64 bytes)
bInterval                : 0x00 (never NAKs)
Data (HexDump)           : 07 05 02 02 40 00 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 篇笔记 写笔记

UAC 其它速率配置描述符
在UAC规范中,并没有定义特别的其它速率配置描述符,故UAC音频设备的其它速率描述符应符合USB规范中的其它速率配置描述符。......
UAC 设备限定描述符
设备限定描述符是USB标准描述中的一类,用于当设备支持全速与高速的情况下必须存在。UAC的设备限定描述符和USB的设备描述符一样,由于音频设备在USB规范中只能定义在接口级别。所以UAC的设备限定描述符bDeviceClass、bDeviceSubClass和bDeviceProtocol字段也必......
USB 其它速率配置描述符
它速率配置描述符(OTHER_SPEED_CONFIGURATION)。其它速率配置描述符设备限定描述符(Device Qualifier Descriptor)配合使用, 当工作在其他速度下时使用, 除了描述符类型, 其他字段含义格式与配置描述符完全一致。 位移字段名称长度(字节......
USB 设备限定描述符
设备限定描述符描述符用在当一个设备能够工作在不同的速度下时,会获取设备限定描述符。同时支持全速与高速的设备,必须有一个Device Qualifier Descriptor。当设备转换速度的时候,设备描述符中的某些字段可能改变。Device Qualifier Descriptor描述符储存当前不......
USB 设备同时支持全速模式与高速模式
当一个USB高速设备接入全速的HUB时,这时会出现高速模式协商失败,这时为了设备能正常使用,会自动使用全速模式来运行。所以为了同时支持全速与高速的设备,必须有Device Qualifier Descriptor和其它速率配置描述符(OTHER_SPEED_CONFIGURATION),用于描述全速......
关注公众号
取消
感谢您的支持,我会继续努力的!
扫码支持
扫码打赏,你说多少就多少

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

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