Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

USB CV TD9.4问题 #268

Closed
1 task
hirex opened this issue Oct 26, 2024 · 1 comment
Closed
1 task

USB CV TD9.4问题 #268

hirex opened this issue Oct 26, 2024 · 1 comment

Comments

@hirex
Copy link

hirex commented Oct 26, 2024

描述一下这个bug / Describe the bug

使用USB CV第9章测试,遇到这种接口 描述符 bAlternateSetting
---------------- Interface Descriptor -----------------
bLength : 0x09 (9 bytes)
bDescriptorType : 0x04 (Interface Descriptor)
bInterfaceNumber : 0x02 (Interface 2)
bAlternateSetting : 0x00
bNumEndpoints : 0x00 (Default Control Pipe only)
bInterfaceClass : 0x01 (Audio)
bInterfaceSubClass : 0x02 (Audio Streaming)
bInterfaceProtocol : 0x00
iInterface : 0x00 (No String Descriptor)
Data (HexDump) : 09 04 02 00 00 01 02 00 00 .........

    ---------------- Interface Descriptor -----------------

bLength : 0x09 (9 bytes)
bDescriptorType : 0x04 (Interface Descriptor)
bInterfaceNumber : 0x02 (Interface 2)
bAlternateSetting : 0x01
bNumEndpoints : 0x01 (1 Endpoint)
bInterfaceClass : 0x01 (Audio)
bInterfaceSubClass : 0x02 (Audio Streaming)
bInterfaceProtocol : 0x00
iInterface : 0x00 (No String Descriptor)
Data (HexDump) : 09 04 02 01 01 01 02 00 00 .........

会报以下错误:
FAIL (USB: 1.2.51) A successful GetInterface request must return the alternate setting set by a prior call to SetInterface.

原因,usbd_core.c USB_REQUEST_GET_INTERFACE简单的赋值为0 导致的,需要USB_REQUEST_SET_INTERFACE备份alt,再返回。
image

复现步骤 / To Reproduce

必现

设备信息 / Target Device

STM32F407

日志 / Log

FAIL (USB: 1.2.51) A successful GetInterface request must return the alternate setting set by a prior call to SetInterface.

配置 / Configuration

No response

USB中断 / USB Interrupt

No response

缓存 / Cache

No response

商业 / Business

  • 是 / Yes
@sakumisu
Copy link
Collaborator

谢谢,这个可以修改掉。我们测试没有测多个alt的

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants