cancel
Showing results for 
Search instead for 
Did you mean: 

STM32CubeF4: Usb documentation

Terry Barnaby
Associate III
Posted on February 28, 2014 at 16:28

Is there any documentation or examples for the new USB stack in the STM32CubeF4 code library ?

I need to implement an USB Virtual Com port. I have done this for the older usb stack in the STM32F4-Discovery_FW_V1.1.0 library, but there doesn't seem to be any info on the new API.

8 REPLIES 8
tbulsink9
Associate II
Posted on March 03, 2014 at 15:35

I am also having troubles generating a working USB CDC skeleton for the STMF4Discovery board : it seems there is no communication between the PC and the uC as even the device descriptor is not received by the host.

Have you been able to at least get that far?

tbulsink9
Associate II
Posted on March 04, 2014 at 14:14

Does this mean that generating a new CDC skeleton does not work yet?

I have tested it now with a project based on the older USB libraries and verified that at least the hardware is ok, but the generated project from StmCuneMx/Stm32CubeF4 fails to enumerate the USB device correctly.

matteo
Associate II
Posted on March 21, 2014 at 18:45

Hello,

I have the exact same problem as the other posters.

Currently I am working on a workaround based on libraries for previous boards (found on the forums here), but I'd rather avoid using them because they seem to be deprecated.

Best,

Matteo

Posted on March 23, 2014 at 02:59

I'd rather avoid using them because they seem to be deprecated.

The deprecation is, however rather self serving, the code was never heavily supported, and all this stuff is provided as-is, effort is required to test and evaluate it, and bring it up to commercial grade. Microsoft consistently releases new versions of things, and often just changes things rather than fix the stuff that is broken, or address the real architectural weaknesses.

ST released the Cube stuff about a month ago, they promise support across multiple STM32 platforms, I can tell you from experience that these platform are somewhat diverse, and not wholly compatible with each other, and as such attempts to unify them will likely result is some level of compromise. I'd personally prefer to tackle that head on, rather than rely on this artificial ''sameness'', and the bloat it will bring with it.
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
richard239955
Associate II
Posted on March 25, 2014 at 18:38

I disabled (by default it's enabled) the ''Dedicated end point 1 interrupt'' in the USB_FS configuration menu, which made the device appear as virtual com port, as intended. When this interrupt is enabled I only register a ''unknown usb device''. Does anyone know what this interrupt is? I couldn't find any information in the ref manual and was too lazy to debug to see which bit is set/reset...

richard239955
Associate II
Posted on March 26, 2014 at 19:18

Just a little update that might help you out: after another day of debugging the USB CDC firmware (the VCP would show up but always with error code 10, saying the device couldn't be started), I figured that CubeMX did not write the '' Maximum number of supported interface'' variable (you find it in the config menu of the cdc middleware) in the usbd_conf.h file. Whatever you type in the config menu, the usbd_conf.h file will always show the same default values. Changing that manually made the VCP start normally, although still the serial number is not transmitted.

This is a clear STM32CubeMX bug that someone should fix.
anders
Associate
Posted on April 08, 2014 at 12:31

Now it's April. Where can I find the Usb documentation?

stm32cube-t
Senior III
Posted on June 05, 2014 at 17:55

Hello,

Max number of interface issue is fixed in MX 4.2.

USB documentation can be found at:

http://www.st.com/st-web-ui/static/active/en/resource/technical/document/user_manual/DM00108129.pdf

.