cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F4-Discovery USB-CDC VCP - Device Enumeration Fails

awi1
Associate II
Posted on April 28, 2014 at 12:47

Hello to everybody,

using the USB-Device example for the STM324xG_EVAL (CDC-Standalone) I tried to get USB up and running on the STM32F4-Discovery-Board. The example is taken from the latest version of the STM32Cube firmware package.

My problem is, that I had no success getting USB to work correctly. All I get is a error message (Windows) saying ''Enumeration of device failed''.

Up to now, I already verified the system clock to be correct by toggling a GPIO pin in the SysTick ISR. The pin state toggles every 1 ms, which matches the required SysTick interval.

Also, I checked the preprocessor definitions, currently the following are defined:

  • STM32F407xx
  • USE_HAL_DRIVER
  • USE_USB_FS
  • HSE_VALUE=8000000
  • HSI_VALUE=16000000
  • HSE_STARTUP_TIMEOUT=5000

I have attached my main.c and main.h file, and also a screenshot of the CrossStudio project explorer.

My goal is to have a communication channel for �C <-> PC and vice versa - is the CDC-VCP example a good starting point?

What could be the cause of my problem? I already investigated this for many hours, but without any success.

If you need more information, please don't hesitate to ask.

Thanks in advance!

Alexander W.

#usb #stm32 #stm32f4 #discovery
6 REPLIES 6
chen
Associate II
Posted on April 29, 2014 at 11:51

Hi

I do not have time to look at your code (I too busy at work at the moment).

''My goal is to have a communication channel for µC <-> PC and vice versa - is the CDC-VCP example a good starting point?''

Yes.

''What could be the cause of my problem?''

Check the clocking of the USB peripheral. It MUST be 48MHz to work correctly.

The fact that windows host PC see something suggests the USB core is working.

Unable to enumerate - may be that the USB bit freq is wrong suggesting that the USB peripheral is being clocked at wrong freq.

(This was the problem when I did the USB work - however, it might be something else)

awi1
Associate II
Posted on April 30, 2014 at 14:12

Hello,

I have done further research on the problem, but with no success.

Because of the fact that the same error occured just after unboxing (with stock flash contents), when trying to use the HID-Accelerometer example, I've buyed another STM32F4-Discovery board.

The result was exactly the same, the device manager stated that a failure occured when trying to get a device description - even with the preinstalled sample. After that, I used another PC, but the problem still occured.

I also tried to flash various precompiled .ELF-Files directly, all taken out of sample applications regarding USB for the STM32F4-DISCO found on the internet. None of these applications worked.

Now, it seems to me that something on the STM32F4-Discovery Board is screwed up. Is anybody from ST present in this forum?

I am really disappointed about the development experience with the board and have already spent several days with troubleshooting.

Kind regards

Alexander
chen
Associate II
Posted on April 30, 2014 at 16:17

Hi

There are 3 different STM32F4 eval boards :

http://www.st.com/web/catalog/tools/FM116/SC959/SS1532/LN1848/PF252419

http://www.st.com/web/catalog/tools/FM116/SC959/SS1532/LN1848/PF259098

http://www.st.com/web/catalog/tools/FM116/SC959/SS1532/LN1848/PF259090

''I also tried to flash various precompiled .ELF-Files directly, all taken out of sample applications regarding USB for the STM32F4-DISCO found on the internet. ''

Only the 'Firmware packages' for each specific board will work, look for them under ''Related Tools and Software''

Download the one for your specific board !

The probability of have 2 bad boards is small (but not impossible)

Posted on April 30, 2014 at 16:45

Is anybody from ST present in this forum?

Not really, this is a user forum, and the Cube stuff is on the other STM32 forum page. I'm not interested in providing support for it.

I've previously posted working STM32F4-DISCO VCP examples using the earlier FW libraries, and building under GNU/GCC
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
awi1
Associate II
Posted on April 30, 2014 at 17:50

The flashed ELF-files were especially for the STM32F407VG-Controller, as this is the controller on my Discovery board. They were download from different websites and were not part of the firmware package.

In addition, I also compiled and flashed a CDC-VCP example, which uses the old Firmware Lib, without success.

chen
Associate II
Posted on May 01, 2014 at 10:42

''The flashed ELF-files were especially for the STM32F407VG-Controller, as this is the controller on my Discovery board. They were download from different websites and were not part of the firmware package.''

You cannot just load an ELF designed for 1 board onto your board and expect it to work!

The Pin IO is probably different for a start, let alone the clocking scheme!

''I tried to get USB up and running on the STM32F4-Discovery-Board. The example is taken from the latest version of the STM32Cube firmware package.''

Since you have a STM32F4 Discovery board - try to get that running as a USB demo first.

I have not tried the STM32Cube myself. I have successfully used  the USB OTG library from ST

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