On Thu, 21 Apr 2011, Ramya Desai wrote: > We have written an application with the mentioned IOCTL. Then we are > able to reset our device with this application. However, we are not > able to see the required behavior after reset the device through > application. The complete scenario is as follows. > > We have a USB CDC device and boot loader application for it. The boot > loader application loads the firmware into the device through a serial > communication. To load another firmware (or modified one), we need to > disconnect the device from the Linux box and re-connecting it back. > Every time, whenever, we modify the firmware, we are disconnecting and > re-connecting it back to load the modified firmware onto the device. > Instead of doing so, we want to simulate the same behavior using some > commands either through an application or from command prompt. > > So, we developed a new application for resetting the USB CDC device > through application using mentioned IOCTL. After running this > application, we are not able to load the modified firmware on to the > device. What happens when you try to load the modified firmware? > However, if we disconnect and connect it back, then we are > able to load the modified firmware. > > I think, there is some difference between 1) disconnect and connect it > back and 2) resetting the device through IOCTL from an application. Of course there is a difference. When you unplug the device, you disconnect the +5V power pin; but when you reset the device, bus power remains present the entire time. > How can I get the same behavior that I am getting with device > disconnect and connect it back with some commands? That depends on your device. Since you have hardly provided any information about it, I can't tell you what to do. Maybe the device won't accept new firmware until the +5V power line has been disconnected -- if that's the case then there's nothing you can do. One thing you might need to know: If your application uses the current version of libusb, it should close the device handle before the reset occurs and re-open the device after the reset. > FYI: I am able to see reset command and enumeration of the device in > the Ellisys analyzer when we reset the device through an application > with an IOCTL. > > Please let me know, if you need any additional information. I will provide. Can you post a usbmon trace, starting from before the reset and ending after you try to load the modified firmware? Alan Stern -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html