How is a device descriptor created and loaded on a new USB device so Windows will recognize it? - usb

I have this device that has a micro usb soldered onto it. When I plug it into my computer, Windows throws the error, "Device descriptor request failed". I believe this is because there is no device descriptor on the device, so the request returns nothing.
My question is:
How can I load a device descriptor onto the device so Windows will be able to enumerate it in the future?

Related

on windows 7/8, how to read usb device descriptor from a usb camera, and read picture stream with webcam meanwhile

I use webcam-capture(java api) to get video stream from a usb camera, it work fine.
I want read a usb device descriptor(store some private information), i find out that should install WinUSB or libusbk as a driver to the usb devices. and it test ok, read the descriptor success (by libusb_control_transfer api)
the question is:
befor I install WinUSB, the usb camera is a camera device in the windows device management list. the LibUSB work fail, can't open the usb devices, the error number is -5, means entrypoin not find
after I install WinUSB, libUSB api work ok, but the webcam program can't open the usb devices, it is a universal usb device in the windows device management list.
is there some way the webcam work ok, at the same time, i can read the usb device descriptor use libusb or use other something?
i tested on windows 7 and windows 8, have the same problem.
thanks.
Sadly this is not possible because each of your applications needs a different driver. The only way this can work is if you use libusb and build you own capturing api on top which is quite complicated. As long as webcam-capture can not read the data you want to know about the webcam I am afraid this is not possible.

Can I duplicate the behavior of one tty on another tty device

I am currently developing an application that connects to a device via USB but due to project modifications I have to move it to a target device whose only serial communication is via RS-232 DE-9 port.
To communicate with the device I use a proprietary API. Using strace I know that it scans all devices in /dev/bus/usb and after finding the right one the API connects to it.
I wanted to know if I could some how emulate my device in /dev/ttyS0 to an unused usb device in /dev/bus/usb/ to connect to it

GPIO device detected on Embedded device When connected, but not able to communicate

I am trying to communicate to my embedded(set-top box) device through this(http://numato.com/8-channel-usb-gpio-module) GPIO. Previously, when i attached this device to my set top box, then in dmesg, it is showing only that new usb device has been attached and by some hook/crook method, i manually created a node with major minor number of recently attached usb device and through my cross compiled c program, i tried to send gpio commands, which throws me the errors of invalid commands. After some more research, i get to know that on my set top box kernel, ACM CDC support is disabled. so i compiled the kernel again with CDC ACM support enabled and USB serial convertor support enabled. after flashing the kernel on BOX, now when i attached the device, in dmesg, it is showing that device is attached, New ACM device detected on ttyACM0, but no node is created in /dev, instead i found the device info in /sys/class/tty/ttyACM0. from here, i get the major and minor number of my device and manually created a node. after that i tried to communicate again, but now, instead of saying invalid command, my program is stuck on the first GPIO command and it is not executing any GPIO commands, but giving me the output of all the printf statements at application layer. please help.
Thanks in advance

Virtual COM Communications Issue

I'm working on a Communications Device Class (CDC) driver for an embedded device, a Full Speed implementation of USB 2.0. The COM port settings are 115200, 8-bit, no parity, 1 stop bit, no flow control. Our PC application (32-bit, Windows 7, .NET 2.0) communicates with the target device through a virtual COM port, which on the target device can connect to either a FTDI (USB-to-SCI bridge) chip or the integrated USB peripheral in the microcontroller, depending on which port is selected by the application.
Both virtual COM ports work without any problems using Realterm. However, while our desktop application works using the virtual COM port connected via the FTDI chip, it hangs when attempting to use the virtual COM connected via the microcontroller's integrated USB peripheral.
When connected via the virtual COM port using the integrated USB, the application consistently hangs on the second call to SerialPort.Write(...). Using Serial Monitor from HHD Software I can see that the data is transmitted on the first call to SerialPort.Write(...). However, that data is never received by the target device.
It's odd because the only time I have seen similar problems on previous projects was when the flow control settings on each side of the bus were mismatched.
Additional info...
Here is the data captured from various port monitoring tools while running our PC application connected to the target device via its integrated USB peripheral. Any insight would be appreciated.
Sysinternals Portmon
Advanced USB Port Monitor
Device Monitoring Studio - Request View
Device Monitoring Studio - Packet View
For those that are interested, I am using CodeWarrior 10.2 with the MCF51JM128 from Freescale.
Any ideas or suggestions would be appreciated. Thanks.
It is clear from the logs that you are making the classic mistake of not taking care of the hardware handshaking signals. That only ever works by accident, a terminal emulator like Realterm will never make that mistake.
You must set the DtrEnable property to true. That turns on the Data Terminal Ready signal. It is important because RS-232 is an unterminated bus so is subject to electrical noise when the cable is disconnected or the power turned off. DTR convinces the device that it is in fact connected to a powered device. This is emulated of course in your case but the driver or firmware will still typically implement the RS-232 behavior.
And the RtsEnable property is important, used to handshake with the device and prevent the receive buffer from overflowing when the app isn't emptying the buffer in a timely matter. You really should set the Handshake property to Handshake.RequestToSend, the most common way a device implements it. Which then also takes care of turning RTS on. If you have to use Handshake.None for some reason then you have to turn it on yourself by setting RtsEnable to true.
This ought to take of the problem. If you still have trouble then use PortMon to spy on the way Realterm initializes the driver. Compare the commands you see against the commands that the SerialPort class sends. Make sure they are the same. In value, not in sequence.

communication to usb port by using vc++2008

I want to communicate to halios system(hardware) through usb port. I have a code which shows that the device is attached. I used USBTrace which shows that how many bytes are going in and out from the device to the host. But I do not know how to implement this is vc++2008 and by using windows xp.
If this is an evaluation board for an Elmos optical sensor IC I would guess that a USB to serial converter is involved. You could confirm this by watching Windows Device Manager for a new COM port appearing when you attach the device.
If that's the case you can use Basic example of serial communication with Windows XP/win32 but you may need to contact Elmos for the command protocol.