cancel
Showing results for 
Search instead for 
Did you mean: 

Help transfering data to PC

pumzele
Associate II
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
26 REPLIES 26
mard
Associate II
Posted on January 22, 2012 at 00:57

We also have the demo example for our readers here: 

http://mcu.cz/comment-n2800.html

But now we are writing the new part of article series about the Custom HID USB implementation and I have to tell, that actuall content of F4 USB library is awful. The implementation of HID class is not general, but only special mouse implementation. It's really plenty of work to translate this version of library to same usable one. But I am working at this 2 days and I hope that I will build the correct version tomorrow. :(

roko
Associate
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 II
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
Associate
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
Associate II
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
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? 🙂

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
Up vote any posts that you find helpful, it shows what's working..