STM32F103RC实现USB HID设备,插入电脑未能成功安装设备驱动程序Bus Hound 抓到USTS c0004000 intfc not found

lalalaxy 2019-01-24 02:36:29
STM32F103RC实现USB HID设备
插入电脑未能成功安装设备驱动程序


Bus Hound 抓到USTS c0004000 intfc not found,找不到接口interface

问题可能出在哪,完全没头绪。
...全文
702 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
007菜鸟 2020-03-12
  • 打赏
  • 举报
回复
0x40, /* bMaxPacketSize0: Maximum packet size for endpoint zero */ 改为 0x08
iwetuan 2019-02-08
  • 打赏
  • 举报
回复
st就有usb的库和demo,先用demo调试,然后换到你自己的项目上找相关问题!
lalalaxy 2019-01-24
  • 打赏
  • 举报
回复
还需要什么,我再补上。
能给一个方向一个思路也行,说一下可能是哪里的问题导致这个问题的,我循这个方向去查一下。
lalalaxy 2019-01-24
  • 打赏
  • 举报
回复
补上几个描述符
const uint8_t USB_DeviceDescriptor[18] =
{
0x12, /* bLength: Size of this descriptor in bytes */
0x01, /* bDescriptorType: DEVICE Descriptor Type */
0x00, /* bcdUSB: version 2.00=0200, 1.10=0110 */
0x02,
0x00, /* bDeviceClass: each interface define the device class */
0x00, /* bDeviceSubClass */
0x00, /* bDeviceProtocol */
0x40, /* bMaxPacketSize0: Maximum packet size for endpoint zero */
0x83, /* idVendor: (0483) Vendor ID (assigned by the USB-IF) */
0x04,
0x20, /* idProduct: Product ID (assigned by the manufacturer) */
0x57,
0x00, /* bcdDevice: 2.00 Device release number in binary-coded decimal */
0x02,
0x01, /* iManufacturer: Index of string descriptor describing manufacturer */
0x02, /* iProduct: Index of string descriptor describing product */
0x03, /* iSerialNumber: Index of string descriptor describing the device's serial number */
0x01 /* bNumConfigurations: Number of possible configurations */
};

const uint8_t USB_ConfigDescriptor[41] =
{
0x09, /* bLength: Size of this descriptor in bytes */
0x02, /* bDescriptorType: CONFIGURATION Descriptor Type */
0x29, /* wTotalLength: Total length of data returned for this configuration. */
0x00,
0x01, /* bNumInterfaces: Number of interfaces supported by this configuration */
0x01, /* bConfigurationValue: Configuration value */
0x00, /* iConfiguration: Index of string descriptor describing this configuration */
0xE0, /* bmAttributes: self powered */
0x32, /* MaxPower: 100 mA, 0x01 represent 1mA */

/******************** Descriptor of interface ********************/
/* 09 */
0x09, /* bLength: Size of this descriptor in bytes */
0x04, /* bDescriptorType: Interface*/
0x00, /* bInterfaceNumber: Index of Interface */
0x00, /* bAlternateSetting: Alternate setting */
0x03, /* bNumEndpoints: Number of endpoint */
0x03, /* bInterfaceClass: HID Class */
0x00, /* bInterfaceSubClass : 1=BOOT, 0=no boot */
0x00, /* nInterfaceProtocol : 0=none, 1=keyboard, 2=mouse */
0x04, /* iInterface: Index of string descriptor describing this interface*/

/******************** Descriptor of HID ********************/
/* 18 */
0x09, /* bLength: HID Descriptor size */
0x21, /* bDescriptorType: HID */
0x10, /* bcdHID: HID Class Spec release number */
0x01,
0x00, /* bCountryCode: Hardware target country */
0x01, /* bNumDescriptors: Number of HID class descriptors to follow */
0x22, /* bDescriptorType */
0x30, /* wItemLength: Total length of Report descriptor */
0x00,
/* [bDescriptorType] */
/* [wItemLength] */

/******************** Descriptor of Endpoint ********************/
/* 27 */
0x07, /* bLength: Endpoint descriptor length = 7 */
0x05, /* bDescriptorType: Endpoint descriptor type */
0x81, /* bEndpointAddress: (IN, address 1). bit7:1-IN, 0-OUT. bit6-4: reserve. bit3-0: endpoint address */
0x03, /* bmAttributes: Interrupt endpoint type */
0x40, /* wMaxPacketSize: Maximum packet size (64 bytes) */
0x00,
0x0A, /* bInterval: Polling interval in milliseconds */
/* 34 */
0x07, /* bLength: Endpoint descriptor length = 7 */
0x05, /* bDescriptorType: Endpoint descriptor type */
0x02, /* bEndpointAddress: (OUT, address 2). bit7:1-IN, 0-OUT. bit6-4: reserve. bit3-0: endpoint address */
0x03, /* bmAttributes: Interrupt endpoint type */
0x40, /* wMaxPacketSize: Maximum packet size (64 bytes) */
0x00,
0x0A /* bInterval: Polling interval in milliseconds */
/* 41 */
};

const uint8_t USB_ReportDescriptor[USB_SIZ_REPORT_DESC] =
{
0x06, 0xFF, 0x00, /* USAGE_PAGE (Vendor Page: 0xFF00) */
0x09, 0x01, /* USAGE (Demo Kit) */
0xA1, 0x01, /* COLLECTION (Application) */

/* Led 1 */
/* 6 */
0x85, 0x01, /* REPORT_ID (1) */
0x09, 0x01, /* USAGE (LED 1) */
0x15, 0x00, /* LOGICAL_MINIMUM (0) */
0x25, 0x01, /* LOGICAL_MAXIMUM (1) */
0x75, 0x08, /* REPORT_SIZE (8) */
0x95, 0x01, /* REPORT_COUNT (1) */
0xB1, 0x82, /* FEATURE (Data,Var,Abs,Vol) */

0x85, 0x01, /* REPORT_ID (1) */
0x09, 0x01, /* USAGE (LED 1) */
0x91, 0x82, /* OUTPUT (Data,Var,Abs,Vol) */

/* Led 2 */
/* 26 */
0x85, 0x02, /* REPORT_ID (2) */
0x09, 0x02, /* USAGE (LED 2) */
0x15, 0x00, /* LOGICAL_MINIMUM (0) */
0x25, 0x01, /* LOGICAL_MAXIMUM (1) */
0x75, 0x08, /* REPORT_SIZE (8) */
0x95, 0x01, /* REPORT_COUNT (1) */
0xB1, 0x82, /* FEATURE (Data,Var,Abs,Vol) */

0x85, 0x02, /* REPORT_ID (2) */
0x09, 0x02, /* USAGE (LED 2) */
0x91, 0x82, /* OUTPUT (Data,Var,Abs,Vol) */

/* 46 */
0xC0 /* END_COLLECTION */
/* 47 */
};
lalalaxy 2019-01-24
  • 打赏
  • 举报
回复 1
补上Bus Hound截图
史上最全USB HID开发资料,悉心整理一个月,亲自测试。 涉及STM32 C51 8051F例子都有源码,VC上位机例子以及源码,USB协议,HID协议,USB抓包工具,开发文档,开发过程文档。 详细内容就不都说了,看目录。 有了这个资料包,你再说开发不了USB HID,打死我都不信! 好资料当然一分都不能少! 目录: STM32_USB_HID_PC_demo:USB HID Demonstrator Release软件和文档 STM32_USB_HID_分析:STM32 USB HID 固件学习分析 STM32_USB_HID_例子:STM32 USB HID方式收发例子。 STM32_USB_HID_学习心得:基于STM32 的USB程序开发笔记、修改STM32的USB例程为自己所用、初涉USB,初学者USB入门总结——枚举。 STM32_固件库说明文档:STM32_USB_Demo例子的中文说明文档。 STM32F107 鼠标USBHID数据发送程序。 USB_HID_8051F例子。 USB_HID_C51源码。 USB_HID_PC_源码:PC端打开HID设备、读写操作实例。 USB_HID_PC接收发送工具:用于调试USB HID设备,就相当于串口工具啦。自己写好了HID设备,用它接收发送调试非常方便。 USB_HID_PC通信详解:PC端HID读写操作说明。 USB_HID_VC++6.0_入门级例子:简单读写USB HID设备,很好的参考作用。 USB_HID_VC++6.0_入门级例子开发步骤(图解说明,真详细啊!):一步一步手把把手教你开发VC++6.0 USB HID程序。 USB_HID_VC++6.0读写设备源码:简单打开HID设备,读写源码,参考的好例子。 USB_HID_VC++6.0源码:出具雏形的VC++6.0 USB HID 工具源码。非常完善了,可以直接当工具使用,关键是有源码! USB_HID_开发过程详细说明:长篇论文一篇,详细说明HID开发过程,包括下位机、上位机、HID驱动的开发,牛! USB_HID协议(英文)。 USB_STM32_HID开发笔记:里面有USB设备枚举的详细过程,抓包说明的哦。当然包括开发过程啦。令牌包、握手包、数据包中的数据都看得到。 USB_URB分析:抓包工具抓到的数据包的详细解析。 USB_VC教程:短论文一篇,用VC++编写USB接口通信程序,简洁扼要说明VC++6.0开发步骤,提纲挈领,值得一看! USB2.0协议(英文)。 USB技术规范(中文):中文的USB技术规范说明,中文的! USB抓包软件:两种抓包工具,bushoundusbtrace。都是破解版,哈哈,自己偷着乐吧! 深入解析STM32_USB库:STM32 USB的库说明。

27,374

社区成员

发帖
与我相关
我的任务
社区描述
硬件/嵌入开发 单片机/工控
社区管理员
  • 单片机/工控社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧