cancel
Showing results for 
Search instead for 
Did you mean: 

Composite USB device CDCs STM32F105

Valentin Grimaldi
Associate
Posted on December 20, 2017 at 11:07

Hi,

I'm working with a STM32F105 board with USB, UART and  CAN ports. I wish  when I connect the board with a computer through USB, multiple VCP are detected.

What I understand is that each interface in a USB composite device need their endpoint. So if I want one VCP for UART and one for CAN I might need 1 common control endpoint, 2 endpoints for UART bulk  and 2 others for CAN bulk. Am I correct ?

In the STM32F1 reference manual(23.2) I can read that there is up to 8 endpoint for the USB but in the Connectivity line for STM32F105/107(2.3.22) there is only 4 bidirectional

endpoint

s. Does it mean that what I'm trying to do with multiple VCP is not possible for my microcontroller ? Or is there 8 monodirectectional endpoints ?

Best regards,

#endpoint #vcp #stm32f105
3 REPLIES 3
Ben K
Senior III
Posted on December 21, 2017 at 18:34

If you want two Virtual COM Ports to be recognized by the PC, you need to reuse the 2 CDC interfaces again. Additionally I recommend that you add Interface Association Descriptors (IAD) for each interface pair.

Therefore the theoretical endpoint demand is 2 IN interrupt EPs, and 2-2 IN-OUT bulk ones. Considering that the interrupt EPs are seldom used, you can simply ignore the allocation for them (only keep it in the descriptor), the VCP works without it. Altogether you need 2 non-control endpoints for both directions, which can be achieved with all USB-capable STM32 devices.

pj
Associate II
Posted on March 30, 2018 at 11:27

You have enough endpoints for it. I am developing the 3xVOM device. No problems at all. But remember that the HAL implementation is buggy and very inefficient .  You need one control and one bidirectional endpoints.

Ben K
Senior III
Posted on March 31, 2018 at 10:25

https://github.com/IntergatedCircuits/USBDevice

allows you to have multiple USB interfaces on the same device, even of the same class. (Follow the standalone solution.) The

https://github.com/IntergatedCircuits/STM32_XPD

peripheral layer has a default endpoint FIFO allocation scheme which is sufficient for most use cases. An efficient UART VCP interface implementation example is available

https://github.com/IntergatedCircuits/DebugDongleFW/blob/master/VCP/vcp_if.c

.