2017-12-20 02:07 AM
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 #stm32f1052017-12-21 09:34 AM
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.
2018-03-30 02:27 AM
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.
2018-03-31 01:25 AM
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.) Thehttps://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 availablehttps://github.com/IntergatedCircuits/DebugDongleFW/blob/master/VCP/vcp_if.c
.