Hello,
in the last months I played a lot with STM32 F4 Ethernet, but now I'd like to have a look at USB (device mode).
From reading some USB related threads I learned that some people use the CDC-VCP mode, others tried with libusb.
In the past I used FTDI USB bridges in both VCP and mainly D2XX mode, which was really simple.
I'm not familiar with libusb details, USB endpoints and stuff like that.
I would like to have the simplicity of a VCP device, but on the other hand I would like to have the 'professional look' of a device which does not appear as COM port in Windows device manager. For the FTDI example, this was possible using the D2XX mode with simple read/write in a Windows DLL. I guess FTDI's D2XX mode is somehow similar to the libusb mode. However, this lisbusb (used under Windows) sound quite complicated to me. Mathias talked about compiling Zadig installers and stuff like that... so I'd like to avoid it.
Is there a simple way to 'hide' the VCP device and get direct access to it?
I still wonder that for the VCP examples the USB driver from ST's website needs to be installed. I thought there is a generic VCP device class which needs no driver for Windows OS!?
One year ago, there was a discussions ongoing where Giovanni managed to get the maximum theoretical USB FS transfer speed. I assumed that this speed of >1MByte/s applies for both VCP mode and libusb mode, but user KAB reported in another thread that he only reached 800kB/s for VCP. What's the reason for this reduced transfer speed?
Sorry about an USB beginner's questions.
Regards, Ruwe
VCP or libusb?
Moderator: RoccoMarco
- Giovanni
- Site Admin
- Posts: 14891
- Joined: Wed May 27, 2009 8:48 am
- Has thanked: 1202 times
- Been thanked: 996 times
Re: VCP or libusb?
Hi,
Making the USB demos not look like VCPs is just matter of changing the descriptors with custom ones. Doing this you will require a custom driver on the host side in order to recognize the device. This more about writing Windows drivers, something I cannot help much on.
About performance, it is matter of packet size and how the application fills the queues, the driver is able to sustain rates very close to the maximum.
Giovanni
Making the USB demos not look like VCPs is just matter of changing the descriptors with custom ones. Doing this you will require a custom driver on the host side in order to recognize the device. This more about writing Windows drivers, something I cannot help much on.
About performance, it is matter of packet size and how the application fills the queues, the driver is able to sustain rates very close to the maximum.
Giovanni
-
rubenswerk
- Posts: 104
- Joined: Wed Feb 22, 2012 11:39 am
Re: VCP or libusb?
Ok, thanks.
This sounds as if it would be a good ideao to start with VCP mode and optimize transmission architecture / buffers for good performance.
After that, I can just change the descriptor to a non-VCP mode and keep the rest of the firmware unmodified. Of course this requires more effort on host side.
Well, maybe I stay with VCP because this Windows driver stuff is something I'd like to avoid...
Bye!
This sounds as if it would be a good ideao to start with VCP mode and optimize transmission architecture / buffers for good performance.
After that, I can just change the descriptor to a non-VCP mode and keep the rest of the firmware unmodified. Of course this requires more effort on host side.
Well, maybe I stay with VCP because this Windows driver stuff is something I'd like to avoid...
Bye!
Re: VCP or libusb?
You have a few options:
FTDI Libraries:
VCP (closed source)
D2XX (closed source)
libFTDI (open source)
Low level usb libraries:
WinUSB (closed source)
LibUSB (open source)
D2XX uses WinUSB on windows platforms and libusb on Linux/OSX.
libFTDI uses libusb only.
I use both WinUSB and libUsb for my projects, they somewhat work the same way.
If you use low level USB libraries you have to handle a lot more things compared to the FTDI libraries.
if you want the easiest, just use the VCP.
The most professional looking would be D2XX.
Anything based on libusb, you will need some sorts of hacks on windows...
The best solution would be LibFTDI with WinUSB on windows and libusb on linux but I don't think you can do it without modifying the library.
FTDI Libraries:
VCP (closed source)
D2XX (closed source)
libFTDI (open source)
Low level usb libraries:
WinUSB (closed source)
LibUSB (open source)
D2XX uses WinUSB on windows platforms and libusb on Linux/OSX.
libFTDI uses libusb only.
I use both WinUSB and libUsb for my projects, they somewhat work the same way.
If you use low level USB libraries you have to handle a lot more things compared to the FTDI libraries.
if you want the easiest, just use the VCP.
The most professional looking would be D2XX.
Anything based on libusb, you will need some sorts of hacks on windows...
The best solution would be LibFTDI with WinUSB on windows and libusb on linux but I don't think you can do it without modifying the library.