USB Custom HID transfer big size data failed
I'm trying to use High speed USB HID to transfer bulk data from external SDRAM controlled via FMC.
I have achieved the basic transfer function by modifying the USB description file and related functions.
/******************** Descriptor of Custom HID endpoints ********************/
/* 27 */
0x07, /* bLength: Endpoint Descriptor size */
USB_DESC_TYPE_ENDPOINT, /* bDescriptorType: */
CUSTOM_HID_EPIN_ADDR, /* bEndpointAddress: Endpoint Address (IN) */
0x02, /* bmAttributes: Bulk endpoint */
0x00, /* wMaxPacketSize: 512 Bytes max */
CUSTOM_HID_EPIN_SIZE>>8,
CUSTOM_HID_HS_BINTERVAL, /* bInterval: Polling Interval */
/* 34 */
0x07, /* bLength: Endpoint Descriptor size */
USB_DESC_TYPE_ENDPOINT, /* bDescriptorType: */
CUSTOM_HID_EPOUT_ADDR, /* bEndpointAddress: Endpoint Address (OUT) */
0x02, /* bmAttributes: Bulk endpoint */
0x00, /* wMaxPacketSize: 512 Bytes max */
CUSTOM_HID_EPOUT_SIZE>>8,
CUSTOM_HID_HS_BINTERVAL, /* bInterval: Polling Interval */
/* 41 */
/******************** Funciton of Sending Data ********************/
uint8_t USBD_CUSTOM_HID_SendReport(USBD_HandleTypeDef *pdev,
uint8_t *report, uint32_t len)
USBD_StatusTypeDef USBD_LL_Transmit(USBD_HandleTypeDef *pdev, uint8_t ep_addr, uint8_t *pbuf, uint32_t size)
When I try to transfer data longer than 19-bit (0x7fff, 524287), it will cause the USB to fail to transfer.
If the oversized data is cut to a length of no more than 19-bit, the entire SDRAM (32MB) data can be transferred correctly.
Is it because of some limitation of the Custom HID Class that I don't know about?
Hope STM32CUBEIDE will provide USB Custom Class generation!!
