cancel
Showing results for 
Search instead for 
Did you mean: 

STM32CubeMX USB Virtual Com Port

adriano
Associate II
Posted on December 08, 2014 at 16:42

Hi everybody,

I recently bought a STM32F3Discovery board for a project. I made some experiments and tried to get an idea of how it works, and then I decided to set up a VCM in order to have better feedbacks from the board and communicate with it (i.e. to set parameters ''on the fly'').

I have been tryin for some days, but I'm having some serious issues with that. I am using CubeMX to generate the initialization code for my project: i set up pins GPIOA11 and GPIOA12 as USB DM and DP, and selected the USB Device option under ''Middlewares'' (Communication Device Class). I set up some parameters and let the code be generated... and that's pretty much all. I don't get how to use it, communication doesn't work, the CDC_Transmit functions (in the automatically generated file usbd_cdc_if.c) fall into an infinite loop or something like that. I searched for some code examples, but they all work with the StdPeriph and most of them are written for the STM32F4 board...

please, help me :(
4 REPLIES 4
Amel NASRI
ST Employee
Posted on December 09, 2014 at 13:57

Hi ApBrandy,

You should find many examples in the STM32CubeF3 package (http://www.st.com/web/en/catalog/tools/PF260613).

-Mayla-

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

adriano
Associate II
Posted on December 09, 2014 at 14:19

Hi Mayla, thanks for your reply.

Didn't find anything about CDC communication, only DFU and HID examples. Am I looking in the wrong place?

Amel NASRI
ST Employee
Posted on December 09, 2014 at 14:53

Look at STM32Cube_FW_F3_V1.1.0\Middlewares\ST\STM32_USB_Device_Library\Class\CDC.

-Mayla-

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

adriano
Associate II
Posted on December 09, 2014 at 15:00

I had already looked there, and those seem to be the files automatically included in my project by CubeMX when I select the CDC middleware option in the pinout panel. Unfortunately, they don't seem to work properly

EDIT - solved. Looks like there was a bug in the initialization code. I found the solution here:

https://my.st.com/public/STe2ecommunities/mcu/Lists/STM32Java/flat.aspx?RootFolder=%2Fpublic%2FSTe2ecommunities%2Fmcu%2FLists%2FSTM32Java%2FUSB%20CDC%20Bug%20in%20CubeMX%20firmware&FolderCTID=0x01200200770978C69A1141439FE559EB459D758000F9A0E3A95BA69146A17C2E80209ADC21&currentviews=2021

Thanks.

reEDIT - still have a problem here: the board gets stuck in the com protocol and doesn't do anything else. This thing is becoming a real pain in the neck...