cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F4 Discovery USB CDC - ''usb device not recognized''

kruszi
Associate II
Posted on February 12, 2013 at 17:54

Hi there,

I am working on STM32FDiscovery and USB CDC. For this purpose I used:

/public/STe2ecommunities/mcu/Lists/STM32Discovery/DispForm.aspx?ID=1311

(I do use CooCox). Well Compiling + Linking successes. The USB Device is recognized (Windows sound) but marked as ''USB device not recognized''. However PID is 0x0000 and VID 0x0002.

Any Ideas? Has anyone had this problem?

Thanks a lot

#usb #stm32 #coocox
5 REPLIES 5
Posted on February 12, 2013 at 18:55

We get the impression here that CooCox is a bit of a cluster. They do have their own forum.

There may well be alignment, or define issues you need to address. Can you build it with another, targeted tool chain, as most evaluations will build the small examples, and at least you'll start with something that works or is known, rather than fighting through a whole bunch of unknown unknowns.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
kruszi
Associate II
Posted on February 12, 2013 at 20:34

Hi Clive,

well I recognized that too - now.  The funny thing is I'm working the whole day on a Problem but as soon as I post it I do find the solution within the next hour. As you already guessed it's a pure CooCox problem.

So for everybody migrating to CooCox (GNU CC) a few hints:

  1. check your stm32f4xx_conf.h for the Std Periph Libraries to be included. (#include ''stm32f4xx_adc.h'', etc). Unfortunately these #includes are often commented out. Causes some strange Errors like 'GPIOx not declared' or unknown, etc.
  2. Check startup_stm32f4xx.�? for SystemInit() to be commented in (often commented out)
  3. Use follwing symbol definitions for your project with USB CDC and STM32F4Discovery: (right mouse click in project explorer on the project itself > Configuration > tab 'Compile' > GroupBox 'Defined Symbols' click on 'Add' an add following symbols: USE_STDPERIPH_DRIVER, STM32F4XX, USE_USB_OTG_FS, HSE_VALUE=8000000     (of course not separated by commas (!) - so click 4 times on add and enter each time enter one value)
  4. Do

    never ever

    use system_stm32f4xx.h from the CooCox-library if you are trying to migrate a project from another IDE/compiler to CooCox !!! If provided use the file from the project you are trying to migrate. This quit simple mistake made me loose 3 day for USB CDC. Caused the failure described above in my first post.
  5. Do

    never ever

    use the startup_stm32f4xx.c or startup_stm32f4xx.s from another compiler or IDE than CooCox. This file is specified for the compiler/IDE you are using. Have a look inside the file and you will see (in the comments) for which compiler this file was made. For CooCox simply add in Repository the CMSIS BOOT library by checking the checkbox for this library. Otherwise you'll get a bunch of linker errors.
Thanks a lot - project now working.

rkenjisato
Associate
Posted on November 07, 2013 at 12:11

Hi michael.

I am a beginner for microcontroller programming, so I`m having quite the trouble to implement USB.

Please, could you help me on how you implemented USB CDC on STM32F4Discovery?

I am also using this board and also CooCox, but I am lost on how to build the project based on the link you post before.

Thank you in advance

bjorn2
Associate III
Posted on November 08, 2013 at 07:23

Hi, 

You could take a look here:

http://www.emblocks.org/forum/viewtopic.php?f=26&t=171

these are working examples one with and one without FreeRTOS.

carlos
Associate
Posted on January 12, 2014 at 23:13

You would be

so kind as to

share the

project of

 

COOCOX

for this example.

?

Many greetings

Carlos