cancel
Showing results for 
Search instead for 
Did you mean: 

STM32f407 Dsicovery - USB Communication

aravindma1990
Associate
Posted on June 12, 2012 at 12:59

I am a beginner in the ARM cortex series and so far have successfully managed to program basics like GPIOs ADCs DACs TIMs . Part of my project requires me to transfer all processed data to the PC using USB communication. Can anyone help me get started with this? I have no idea as to what functions to call or initialize. A detailed help would be appreciated

#lmgtfy:-stm32-resources #usb-communication #stm32-discovery
15 REPLIES 15
Posted on June 12, 2012 at 16:06

You could look at the USB code in the firmware library, and the demonstration example.

\STM32F4-Discovery_FW_V1.1.0\Libraries\STM32_USB_Device_Library\Class\cdc

\STM32F4-Discovery_FW_V1.1.0\Project\Demonstration

I think that implements a HID class, what you probably want from a simplicity stand point is a CDC class (Virtual Serial Port)

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Posted on September 20, 2012 at 12:44

Hi Clive1

I have plane for usage USB feature on my project with setting USB for  send high amount of binary data.

Where find ''STM32F4-Discovery_FW_V1.1.0'' library for download?

For HID configuration it's available Windows tool or it's hand make process into source ?

Thank on advance

Posted on September 20, 2012 at 15:51

Web page for board

http://www.st.com/internet/evalboard/product/252419.jsp

Design Support Tab, Firmware Download

http://www.st.com/internet/com/SOFTWARE_RESOURCES/SW_COMPONENT/FIRMWARE/stm32f4discovery_fw.zip

Web page for chip

http://www.st.com/internet/mcu/product/252140.jsp

Design Support Tab, Firmware, USB Code, Targets STM32xxxxX-EVAL boards

http://www.st.com/internet/com/SOFTWARE_RESOURCES/SW_COMPONENT/FIRMWARE/stm32_f105-07_f2_f4_usb-host-device_lib.zip

Bunch of stuff will build in Keil or IAR IDE, perhaps TASKING or ATOLLIC too, but equally portable to any equivalent chain you have competence with, including GNU/GCC + MAKE if that's what you're comfortable with.

The main USB libraries target the EVAL series boards, not the DISCOVERY boards, you'll need to port those examples. I've done the MSC and CDC/VCP under GNU and Keil for the STM32F4-Discovery, and posted several here.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
russdx
Associate II
Posted on September 22, 2012 at 22:35

i found this guys usb/libusb example the most useful

http://www.youtube.com/watch?v=WR9Bv08tMg0

it just worked!! :)

if you dont use atollic true i strongly advice you rebuild the project with another ide as that atollic true ide is the most frustrating thing on the planet!!!!!

rick23
Associate II
Posted on December 01, 2012 at 07:22

Is there a howto on compiling the USB device lib for the STM32L152RBT6 using GCC?  Also please point me to the correct USB device lib for this part,

  Thanks,

Posted on December 01, 2012 at 13:18

Go to the part page for the ''STM32L152RB''

http://www.st.com/internet/mcu/product/248820.jsp

Under the Design Support tab, the USB FS library

http://www.st.com/internet/com/SOFTWARE_RESOURCES/SW_COMPONENT/FIRMWARE/stm32_usb-fs-device_lib.zip

As for GCC, you probably just want to pull the source files into one directory, use the RIDE startup code, and use a generic makefile, and part compatible linker script, and make it.

Any particular reason to choose GNU/GCC? Over one of the other evaluation IDE where you load the project, press the button and the code drops out? Even if that's not your final destination, at least you'd see how the project is composed, built and debugged.
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
rick23
Associate II
Posted on December 01, 2012 at 22:02

  My clients products are all Linux based so it makes sense for them to

use GCC whenever it's possible so that they don't have to deal with

many different toolchains.  I know that GCC isn't always the easiest

but it is well understood and generates pretty good code.

  It would be great if ST could supply a Makefile and linker script

ith the USB lib...

 Thanks very much for the help.

Posted on December 01, 2012 at 23:02

It would be great if ST could supply a Makefile and linker script with the USB lib...

I think they are targeting a different set of users, a simple makefile and linker script shouldn't take much time for someone familiar with the tools. I'm hardly a GNU guru, and I could probably fashion a working solution in less than an hour.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
its
Associate II
Posted on December 03, 2012 at 06:00

whats the maximum speed of VCP?

thanks