cancel
Showing results for 
Search instead for 
Did you mean: 

USB composite device – HID + CDC ACM example on Linux

Lubos KOUDELKA
ST Employee

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.

1 REPLY 1
FHars
Associate II

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.