Skip to main content
pumzele
Associate
Dec 12, 2011 7:47 AM UTC
Question

Help transfering data to PC

Posted on December 12, 2011 at 08:47

Hello there,

I desperatly need help getting data from my stm32f4 to my pc.

I was thinking of using the OTG and set it up as a keyboard and transfer the data accross like that but it seems like a huge mission to transfer data. On older chips they just had an FTDI chip which was very easy to set up and use. Does anyone maybe know of an easier way to transfer data over to my Computer using the built in micro usb? Some sample code will also help a lot as the otg seems very complex

#transfer-data-using-usb #stm32f4discovery-usart-serial-us #vcp(virtual-com-port)-stm32f4 #stm32f4-usb-cdc
This topic has been closed for replies.

26 replies

roko
Visitor II
Feb 11, 2012 3:29 PM UTC
Posted on February 11, 2012 at 16:29

I have managed to establish usb connection between my pc and the discovery board.

I took Mard's VCP example and ripped out all USART stuff.

Changed vendor and product id's so the board was no longer recognized as COM device.

Next i downloaded

http://www.libusb.org/wiki/libusb-win32

.

There is a driver generator in the package.

With those i had the board recognized by windows.

In the libusb package there are some examples and of course library and sources.

With help of libusb-win32 examples i wrote test software.

Here are sources for discovery board and windows application:

http://dl.dropbox.com/u/56124886/stm32f4-discovery/stm32f4-discovery-usb-cdc-example.zip

http://dl.dropbox.com/u/56124886/stm32f4-discovery/usbTest.zip

Some helpful links:

http://codeandlife.com/2012/01/22/avr-attiny-usb-tutorial-part-1/

Well worth reading even though it's for different controller.

And ofcourse big thanks to Mard's VCP tutorial.

khaled3310
Associate III
Mar 8, 2012 7:47 PM UTC
Posted on March 08, 2012 at 20:47

Hi 

I have some problem to send data throw my PC to the USB Micro B port in my stm32 board any idea?? thanx on advance
rraute
Visitor II
Mar 28, 2012 12:09 PM UTC
Posted on March 28, 2012 at 14:09

Hello,

I had a look at your example and it seems pretty nice. I installed libusb and found the the ST-link device (the SWD side of the STM32F4-Discovery board). I am using IAR workbench as development but your STM32F4xx example ''stm32f4-discovery-usb-cdc-example'' is done with Atollic TrueSTUDIO.

Do you have also an example for IAR workbench?

Best regards

hamdi23
Explorer
Oct 10, 2012 10:02 AM UTC
Posted on October 10, 2012 at 12:02

if i want to change the mouse device example in stm32 to a keyboard what changes i have to make in the usbd_desc.c/h file ??? also why the ''USBD_HID_SendReport'' function is  in  SysTick_Handler if we work with the interrupt transfer and what is the real work of the endpoints interruptions in the usbd_hid example for stm32f4 usb otg library?? because i remove it from the joystick example and still works!!

also what is thr difference between the SendReport functon and the DCD_EP_Tx function ??

and why there is no receiving function DCD_EP_PrepareRx ?is the HID class supposed to only send data ?

texton1
Associate II
May 16, 2014 12:25 PM UTC
Posted on May 16, 2014 at 14:25

Really nice! I can't compile though. Dev-c++ gives me ''undefined references'' to all usb-functions. Maybe I haven't installed/linked the libusb right? Can you please help? :)

Tesla DeLorean
Guru
May 16, 2014 1:30 PM UTC
Posted on May 16, 2014 at 15:30

Really nice! I can't compile though. Dev-c++ gives me ''undefined references'' to all usb-functions. Maybe I haven't installed/linked the libusb right? Can you please help? :)

 

Be conscious that you are responding to a post from 2+ years ago, by a person who visited the site once. The site does not email respondents. Consider if there is a more effective way to contact the author of the post/code.
Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..