cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F2xx USB VCP firmware example

ho
Associate II
Posted on October 17, 2014 at 10:04

May I know where can I get the firmware example for STM32F2xx for USB Device VCP???

I tried this link, but the firmware is not working, the USB doesnt emurate!

https://github.com/suapapa/stm32_library/tree/master/Project/USB_Device_Examples/VCP

I tried to download the firmware example in ST website (STM Eval firmware exmaple) but it is using the HAL driver!

I dont want to use the HAL driver, where can I get the sample code?

 

#vcp #usb #stm32
7 REPLIES 7
chen
Associate II
Posted on October 17, 2014 at 11:17

Hi

You are looking the now discontinued USB OTG library :

http://www.st.com/web/catalog/tools/FM147/CL1794/SC961/SS1743/LN1734/PF257882

ho
Associate II
Posted on October 17, 2014 at 11:40

Thank you for giving me the link!

But, I tried this code, it is not working!

My PC cant detect any USB Virtual COM port!!!

Any idea why?

Amel NASRI
ST Employee
Posted on October 17, 2014 at 11:42

You can refer to example in the ''USB on-the-go Host & Device library'' that you can download from

http://www.st.com/web/en/catalog/tools/FM147/CL1794/SC961/SS1743/LN1734/PF257882

. It is using the Standard Peripheral Library.

-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.

chen
Associate II
Posted on October 17, 2014 at 11:46

''But, I tried this code, it is not working!''

1st does it detect the USB device at all?

Does a USB device appear and dissapear when you plug and unplug the STM32?

If the device appears but is listed as 'Unknown Device'

You need to load and install the PC side VCP driver

http://www.st.com/web/en/catalog/tools/PF257938

ho
Associate II
Posted on October 17, 2014 at 14:03

The USB device is not detected at all...

but if I tried using the STM32F2xx_HAL code, it could detect the USB device and STM Virtual Com Port

But, I cant make it works using the standard peripheral library! 

Posted on October 17, 2014 at 14:05

Agree v2.1 is where I started. Worked on my F2 board.

If you have a problem with how the code is ported to your board you'll need to reflect on your design with respect to the target for the code. The target is expected to be the EVAL series boards, which use 25 MHz external crystals, if yours uses an 8 MHz clock, or whatever, then you'll need to adjust the PLL settings, and ensure the USB clock is configured to 48 MHz, and that the PLL is running.
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
ho
Associate II
Posted on October 20, 2014 at 07:39

I have tried all the settings, but I still have no idea why it is not working when using the standard peripheral library

But, I have ported using the HAL library with the standard peripheral library and now it is working

Thanks!