cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F4 USB CDC+MSC+HID Composite Devices

RHuan.1
Associate

I have tried create a USB Composite Device(CDC+MSC+HID) using STM32_USB_Device_Library V1.2.1, CDC and MSC works but HID not workable. When I use USBD_HID_SendReport() to send data to PC, MCU stuck.

I have change the sequence of CDC/MSC/HID Interface/endpoint order, it seems that the last one not workable.

MCU: STM32F429

#define CDC_INTERFACE     0x00

#define CDC_INTERFACE2   0x01

#define MSC_INTERFACE     0x02

#define HID_INTERFACE     0x03

#define CDC_IN_EP           0x81 /* EP1 for data IN */

#define CDC_OUT_EP           0x01 /* EP1 for data OUT */

#define CDC_CMD_EP          0x84 /* EP2 for CDC commands */

#define MSC_IN_EP           0x82

#define MSC_OUT_EP          0x02

#define HID_IN_EP           0x83

CDC/MSC/HID devices were seen in Windows Device Manager.

Please help. Thanks.

1 ACCEPTED SOLUTION

Accepted Solutions
RHuan.1
Associate

Fixed by change following line from "0" to "64" in usb_conf.h.

#define TX3_FIFO_HS_SIZE             64

Thanks.

View solution in original post

2 REPLIES 2
RHuan.1
Associate

Fixed by change following line from "0" to "64" in usb_conf.h.

#define TX3_FIFO_HS_SIZE             64

Thanks.

Thank you so much, I had the exact same problem, FIFO was not configured. In my case I had to call 

HAL_PCDEx_SetTxFiFo(&hpcd_USB_OTG_FS, 2, 0x40);

Best of luck!