打印

STM32 定义两个BULK端点, 为什么只能传输64字节?

[复制链接]
4036|3
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
easylwl|  楼主 | 2013-4-19 11:17 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
自定义一个BULK传输的usb设备.IN端点 0X82  ,OUT端点0X03
设备可以正常枚举,安装驱动,但是想IN端点发送数据时只能发送64字节,小于64字节不成功(PC机上用BUSHOUND看不到数据包)
高手帮忙看看是什么原因??


设备描述符:
    0x12,                       /*bLength */
    USB_DEVICE_DESCRIPTOR_TYPE, /*bDescriptorType*/
    LOBYTE(0x0200),                       /*bcdUSB 2.0*/
    HIBYTE(0x0200),  
    0xff,                       /*bDeviceClass*/
    0x00,                       /*bDeviceSubClass*/
    0x00,                       /*bDeviceProtocol*/
    USB_OTG_MAX_EP0_SIZE,      /*bMaxPacketSize*/
    LOBYTE(USBD_VID),           /*idVendor*/
    HIBYTE(USBD_VID),           /*idVendor*/
    LOBYTE(USBD_PID),           /*idVendor*/
    HIBYTE(USBD_PID),           /*idVendor*/
    0x00,                       /*bcdDevice rel. 2.00*/
    0x02,
    0,    //USBD_IDX_MFC_STR,           /*Index of manufacturer  string*/
    0,  //USBD_IDX_PRODUCT_STR,       /*Index of product string*/
    0,  //USBD_IDX_SERIAL_STR,        /*Index of serial number string*/
    USBD_CFG_MAX_NUM            /*bNumConfigurations*/

配置描述符,端点描述符:
/*Configuration Descriptor*/
  0x09,   /* bLength: Configuration Descriptor size */
  USB_CONFIGURATION_DESCRIPTOR_TYPE,      /* bDescriptorType: Configuration */
  USB_CDC_CONFIG_DESC_SIZ,                /* wTotalLength:no of returned bytes */
  0x00,
  0x01,   /* bNumInterfaces: 1 interface */
  0x01,   /* bConfigurationValue: Configuration value */
  0x00,   /* iConfiguration: Index of string descriptor describing the configuration */
  0xC0,   /* bmAttributes: self powered */
  250,   /* MaxPower 2 mA */
   
  /*Data class interface descriptor*/
  0x09,   /* bLength: Endpoint Descriptor size */
  USB_INTERFACE_DESCRIPTOR_TYPE,  /* bDescriptorType: */
  0x00,   /* bInterfaceNumber: Number of Interface */
  0x00,   /* bAlternateSetting: Alternate setting */
  0x02,   /* bNumEndpoints: Two endpoints used */
  0xff,   /* bInterfaceClass: USER */
  0x00,   /* bInterfaceSubClass: */
  0x00,   /* bInterfaceProtocol: */
  0x00,   /* iInterface: */
  
  //18
  
  /*Endpoint OUT Descriptor*/
  0x07,   /* bLength: Endpoint Descriptor size */
  USB_ENDPOINT_DESCRIPTOR_TYPE,      /* bDescriptorType: Endpoint */
  VL8461_OUT_EP,                        /* bEndpointAddress */
  0x02,                              /* bmAttributes: Bulk */
  LOBYTE(CDC_DATA_MAX_PACKET_SIZE),  /* wMaxPacketSize: */
  HIBYTE(CDC_DATA_MAX_PACKET_SIZE),
  0,                              /* bInterval: ignore for Bulk transfer */
  //25
  /*Endpoint IN Descriptor*/
  0x07,   /* bLength: Endpoint Descriptor size */
  USB_ENDPOINT_DESCRIPTOR_TYPE,      /* bDescriptorType: Endpoint */
  VL8461_IN_EP,                         /* bEndpointAddress */
  0x02,                              /* bmAttributes: Bulk */
  LOBYTE(CDC_DATA_MAX_PACKET_SIZE),  /* wMaxPacketSize: */
  HIBYTE(CDC_DATA_MAX_PACKET_SIZE),
  0                               /* bInterval: ignore for Bulk transfer */
  //32

相关帖子

沙发
woaixia520| | 2013-4-19 11:31 | 只看该作者
这论坛怎么下载附件呢?可用点怎么弄,在哪查看?是要充钱???

使用特权

评论回复
板凳
mmuuss586| | 2013-4-19 20:30 | 只看该作者

使用特权

评论回复
地板
lanmanck| | 2013-5-21 23:32 | 只看该作者
兄弟,我也遇到类似情况,设备已经枚举和加载驱动,只不过端点读写没有中断,是不是读写的时候有什么注意的地方?每个包都要64字节?

使用特权

评论回复
发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

11

主题

28

帖子

0

粉丝