Skip to main content
Visitor II
December 31, 2019
Solved

STM32F4 USB CDC+MSC+HID Composite Devices

  • December 31, 2019
  • 1 reply
  • 1613 views

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.

    This topic has been closed for replies.
    Best answer by RHuan.1

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

    #define TX3_FIFO_HS_SIZE             64

    Thanks.

    1 reply

    RHuan.1AuthorAnswer
    Visitor II
    January 2, 2020

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

    #define TX3_FIFO_HS_SIZE             64

    Thanks.

    Visitor II
    April 20, 2024

    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!