Skip to main content
ST Employee
July 8, 2021
Question

USB composite device – HID + CDC ACM example on Linux

  • July 8, 2021
  • 1 reply
  • 1524 views

Hello,

when using Linux host for testing this example, CDC interface is not detected by the host. Reason is sensitivity on Configuration descriptor content generated by STM32CubeMX, propagated into ux_device_descriptors.c. For now you fix this file manually if you want to verify example functionality with Linux host in ux_device_descriptors.c (~line 806)

 /* Control interface headers */
 pHeadDesc = ((USBD_CDCHeaderFuncDescTypedef *)((uint32_t)pConf + *Sze));
 /* Header Functional Descriptor*/
 pHeadDesc->bLength = 0x05;
 pHeadDesc->bDescriptorType = 0x24;
 pHeadDesc->bDescriptorSubtype = 0x01; //originally 0x00
 pHeadDesc->bcdCDC = 0x0001; //originally 0x1001
 *Sze += (uint32_t)sizeof(USBD_CDCHeaderFuncDescTypedef);

Fix shall be propagated into future version of STM32CubeMX.

    This topic has been closed for replies.

    1 reply

    Visitor II
    July 8, 2021

    Thanks, that works.

    The only thing that might be confusing for the unwary is that the Enter key may (depending on the terminal program one uses) only send a CR (Ctrl-M), if one wants the output to move to the next line, one has to explicitly send a LF (Ctrl-J) in that case.