Is there an example of creating a USB device for an STM32F407VG that isn't a mouse example or requires a device driver to be installed in order to communicate with it?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2019-11-13 12:53 PM
I'm trying to create a USB / Ethernet testing device. I need to use the USB portion to program an IP address. The mouse example works but I cannot detect it or connect to it. The virtual serial port example also works but a driver needs to be installed in order for me to communicate back and forth (not an option in production). Is there a USB device example that is detectable in windows and doesn't need a special driver to connect to it? Thanks in advance for your consideration.
Solved! Go to Solution.
- Labels:
-
STM32CubeMX
-
STM32F4 Series
-
USB
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2019-11-14 8:17 AM
Or see this post or search this forum for CDC_SET_LINE_CODING or CDC_GET_LINE_CODING for examples.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2019-11-13 1:20 PM
You can make a "custom HID" device - if it does not look like mouse or keyboard, the host OS won't claim it.
If you make a serial port device *properly* and have WIndows 10, it has a good in-box driver for it.
But if your goal is a "ethernet" device, WIndows 10 has in-box driver for this as well.
For more details on required device descriptors, you can ask in Microsoft drivers forum here. Right from the beast's mouth.
Finally, if you just need some custom device that works without a driver - use libusb on Linux, or add a special descriptor for Windows and use winusb.
-- pa
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2019-11-14 4:33 AM
Thanks Pavel for the response. The intent is to create a serial port device "properly" as you say. The virtual serial port example does "work" in that when I plug-in the USB cable, Windows sees it, assigns the driver, and shows a new COM port in the Device Manager. This is where the "properly" comes in. I cannot connect to it using the C# serial port class which should be simple. The error I get is "The parameter is invalid". This indicates one of two things. 1. My serial port settings are wrong (baud rate for example) or 2. there is no underlying serial layer on the device side (that's what a search for the error yields.). Since there is no visibility in the example as to what the serial port settings are, I used what the Device Manager stated. If there is any insight you or anyone can give me as to how to get both sides talking to each other, I'd greatly appreciate it. BTW, the Ethernet side for now is not a concern at this point.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2019-11-14 6:16 AM
One usual culprit is that the device does not handle set & get requests for baud rate and other parameters.
Normally all "set" needs to do is to save the parameters that the host passes and in "get" return it back.
Many examples are available on github.
-- pa
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2019-11-14 8:17 AM
Or see this post or search this forum for CDC_SET_LINE_CODING or CDC_GET_LINE_CODING for examples.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2019-11-14 10:48 AM
Perfect Bob, I'm now up and running by implementing the CDC SET/GET LINE CODING case statements. Thanks much for the help.
