cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F429i-DISCO : Use USB as device CDC class (VCP)

mitcharnaud31
Associate II
Posted on October 16, 2013 at 21:03

Hello everybody,

I am stuck during these last days with my STM32F429i-DISCO.

I tried to use it as USB device, CDC class as a VCP.

I have configured the as USE_USB_OTG_HS, USE_EMBEDDED_PHY.

Configure the HS_ISR, Enable the HS_ISR, Enable the RCC clock, configure the PINS.

My PC see the USB device, but not correctly recognized. The SW is stuck in the OTG_HS ISR (triggered infinitly...).

Anyone has the same problems ?

Anyone success to configure USB device VCP ?

I made some checks about PINS and frequencies with guys from the community, put the frequency to 168 Mhz and update the HSE to 8Mhz ... but without success.

Thank your for your feedback about USB device VCP experience ...

#stm32f4 #usb #otg #dual_role
19 REPLIES 19
Posted on October 16, 2013 at 21:51

As I've done before with the STM32F4-DISCO, I ported STM32_USB-Host-Device_Lib_V2.1.0\Project\USB_Device_Examples\VCP to the STM32F429I-Discovery_FW_V1.0.0 release an it's USB libraries.

I have it using USART1 and have PA9/PA10 externally looped so I can see echo from my PC's terminal app.

It's taken a bit of work to get it to this point, and I'm building under Keil.

Using the x64 v1.3.1.0 driver
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
mitcharnaud31
Associate II
Posted on October 16, 2013 at 23:51

That's sound good.

Where did you find this VCP example ?

Is there any chance you send me your SW ?

Thanks again.
mitcharnaud31
Associate II
Posted on October 17, 2013 at 00:01

I find in the forum one of your post with the following link :

https://docs.google.com/file/d/0B7OY5pub_GfIdnREeExyRWNXbFE/edit?usp=drive_web

I will try migrate it to STM32F429-DISCO ...

Posted on October 17, 2013 at 01:12

I'll need to get it into a releasable form

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Posted on October 17, 2013 at 23:46

https://docs.google.com/file/d/0B7OY5pub_GfIYjU3QTJtWVFHNE0/edit?usp=sharing

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
mitcharnaud31
Associate II
Posted on October 18, 2013 at 16:42

Thanks a lot, I will try this during this week-end and I will keep you inform. I hope I will understand what was going wrong ...

Thanks again.
mitcharnaud31
Associate II
Posted on October 22, 2013 at 18:11

Your SW is working on my board.

I did not have a look what was going wrong in mine, but yours is working well.

Thanks.
matteo
Associate II
Posted on March 21, 2014 at 03:41

I apologize for resurrecting this thread.

I am currently getting started in programming on St microcontrollers. Currently I am working on the stm32f429 iDisco board, like the original poster.

I am working with the arm embedded toolchain, using Eclipse as IDE.

I cannot figure out how to build the project you linked. Anything I try, i get a number of errors. Most of them appear to be related to missing headers.

For my previous tests (just causing leds to blink, since I am a beginner) I have been using the stm32Cube tool (which I find to be rather a mess, but that is beside the point), so now I am not sure where to put what.

I put all headers in an ''inc'' floder, and all source files in a ''src'' folder. Both are in my workspace, and the ''inc'' folder is in the include path.

I defined the symbols:

USE_STM32F429I_DISCO

USB_OTG_HS_CORE

USE_USB_OTG_HS

USE_EMBEDDED_PHY

Set like that, I have a compiler error:

C:\Users\Matteo\Documents\ST\STM32F4\VCP2\inc/stm32f429i_discovery.h:231:40: error: unknown type name 'USART_InitTypeDef'

I thought to solve it by adding #include ''stm32f4xx_usart.h'' to the faulty header, but this causes 144 more errors (mostly 'something' undeclared, with some related to attempting to access members of structs for which the declaration cannot be found).

Would you be able to help me figure this out? (Ideally you would give me a solution, and I would magically understand what is going on: since I am not that clever, please if you can explain what is going on).

Best,

Matteo

matteo
Associate II
Posted on March 21, 2014 at 03:42

(I'm sorry for double post... I had a server error... Now I can't find how to delete a post)

I apologize for resurrecting this thread.

I am currently getting started in programming on St microcontrollers. Currently I am working on the stm32f429 iDisco board, like the original poster.

I am working with the arm embedded toolchain, using Eclipse as IDE.

I cannot figure out how to build the project you linked. Anything I try, i get a number of errors. Most of them appear to be related to missing headers.

For my previous tests (just causing leds to blink, since I am a beginner) I have been using the stm32Cube tool (which I find to be rather a mess, but that is beside the point), so now I am not sure where to put what.

I put all headers in an ''inc'' floder, and all source files in a ''src'' folder. Both are in my workspace, and the ''inc'' folder is in the include path.

I defined the symbols:

USE_STM32F429I_DISCO

USB_OTG_HS_CORE

USE_USB_OTG_HS

USE_EMBEDDED_PHY

Set like that, I have a compiler error:

C:\Users\Matteo\Documents\ST\STM32F4\VCP2\inc/stm32f429i_discovery.h:231:40: error: unknown type name 'USART_InitTypeDef'

I thought to solve it by adding #include ''stm32f4xx_usart.h'' to the faulty header, but this causes 144 more errors (mostly 'something' undeclared, with some related to attempting to access members of structs for which the declaration cannot be found).

Would you be able to help me figure this out? (Ideally you would give me a solution, and I would magically understand what is going on: since I am not that clever, please if you can explain what is going on).

Best,

Matteo