cancel
Showing results for 
Search instead for 
Did you mean: 

STM32CubeMX Two VCPs using CDC

moulay-hassan
Associate II
Posted on May 17, 2016 at 14:29

I'm a beginner in USB Stack on STM32F4. I have a question about creating a project using CubeMX (STM32F4 Discovery) for USB CDC to have 2 Virtual Com Ports in the ''Device Manager'' ? Thanks

1 REPLY 1
slimen
Senior
Posted on May 19, 2016 at 15:28

Hi, 

You should install STM32CubeMx version 4.14.0 from this

http://www.st.com/content/st_com/en/products/development-tools/software-development-tools/stm32-software-development-tools/stm32-configurators-and-code-generators/stm32cubemx.html#

In CubeMx 'Pinout' tab, you should enable the USB_OTG_FS peripheral as Device Only.

Then, in the 'Configuration' tab, enable Midlleware USB_Device with (CDC Virtual Port Com).

Make sure to have the STM32 Virtual COM Port Driver on your PC, downloadable at

http://www.st.com/content/st_com/en/products/development-tools/software-development-tools/stm32-software-development-tools/stm32-utilities/stsw-stm32102.html

It should then drive the VCP through ST-Link. If your board is connected to the USB, a virtual com port is created and it appears in the windows device manager under ''Ports (COM & LPT)''.

 

PS: About the code generation, you can refer to this CDC application provided within the STM32CubeF4 version 1.11.0 : 

STM32Cube_FW_F4_V1.11.0\Projects\STM32469I-Discovery\Applications\USB_Host\CDC_Standalone

This application can help you as an implementation example. 

Regards