I'm working on the project in which I should transfer data from a microcontroller to a PC with the USB protocol. I am working with the STM32F407 microcontroller for transferring data to a PC with the USB Protocol.
I am using libsub for transferring data in Windows 7.
I have written a program with STM32cubeMX and configured the USB device class library. I can transfer data with the CDC virtual COM port, but I want to transfer data with libusb. I install the libusb driver for my device, but when I send data from the microcontroller to PC nothing is send!!!!
What is my problem? How can I send data from a USB device to a PC with USB and high speed?
In USB protocol the host device initiates any transfer, for example a bulk transfer. i assume that the ST32f407 is the device and the pc ist the host so the ST32 can not initiate any USB transfer. The communication over virtual COM works because it the virtual COM is like a tunnel, but this tunnel was also initated and is (logically) kept alive by the host (pc)
source: https://msdn.microsoft.com/de-de/library/windows/hardware/ff539199%28v=vs.85%29.aspx
source: https://www.midi.org/articles/basic-of-usb
in usb even interrupts have to wait until the host polls:
source: http://www.beyondlogic.org/usbnutshell/usb4.shtml#Interrupt
See http://www.beyondlogic.org/usbnutshell/usb4.shtml#Bulk for bulk transfers
So you can send data from the device to the host but the host has to establish the communication meaning has 'ask' for the data. This is done via the bulk IN endpoint that is used to read data from the device to the host