windows - Do I need to write my own host side USB driver for a CDC device -
It can not be directly related to programming, but I know where there is a loss to say and to say. I have tried to look at many types of websites, but till now Google is not my friend.
I am having trouble finding out that I need to write my device driver for my Windows / Linux / Mac platforms that can be connected to the device I am developing, Or whether functionality is provided by the standard driver.
My device is a USB CDC (communication device) that appears as COM: port. It also includes a battery charger, which requires a current full supply of 5 unit load (500 MA) for the calculation of the device, which can be pulled from the USB connector. My problem is that if the USB driver in the host decides that he can not turn on full supply then the device must fail to enumerate.
If, as a fallback, I provide a second configuration set which allows the device to attract 1 unit load only from the interface connector, the standard driver uses the device Will enumerate them.
You will have to write a .inf file for Windows which will be installed with your device VID and PID Relates to usbser.sys. I look like this (change your company as needed, put it in your VID and PID (in hex), and change the driverver line to whatever date and version you want):
; -------------------------------------------------- ---------------------------; XP / 2000 USB Comics Port Setup; -------------------------------------------------- --------------------------- [version] DriverVer = 12/03 / 2008,1.0.0000.0000 signature = "$ Windows NT $" class = Port class = {4d36e978-e325-11ce-bfc1-08002be10318} Provider =% YourCompany% [DestinationDirs] DefaultDestDir = 10, system32 \ Drivers DriverCopyFiles = 12 [ControlFlags] ExcludeFromSelect = * [Manufacturer]% YourCOmpany% = YourCompanySerialPort [YourCompanySerialPort] % YourCompanyUSBSerialPort% = YOURCOMPANYUSB, USB \ VID_1234 and PID_ABCD; ; Win 2000 / XP; [YOURCOMPANYUSB] Include = mdmcpq.inf CopyFiles = FakeModemCopyFileSection [YOURCOMPANYUSB.HW] AddReg = YOURCOMPANYUSBAddReg.HW [YOURCOMPANYUSBAddRH.HW] HKR, DevLoader, 0, * ntkern HKR, NTMPDriver, "usbser.sys" [YOURCOMPANYUSB.Services] AddService = Usbser, 0x00000002, FuncDrv_Service_Inst [FuncDrv_Service_Inst] DisplayName =% USBFilterString% Service Type = 1 Start Size = 3 ErrorControl = 0 ServiceByry =% 12% \ usbser.sys [String] YourCompany = "YourCompany" YourCompanySerialPort = "Your Company USB Serial Port" USB Filter String = "USB Serial Service"
Note It works only with 32 bit OS with Vista In that, even though the file is not saying header!
Keep in mind that there are significant issues in some versions of usbser.sys, which also include bluscreening, for example, when packet transfers are the exact multiples of 64 bits. If you are using XP SP2 or the previous install hotfix KB943198 then XP SP3 and Vista are OK.
For Mac you have to report your device class correctly and the driver scan raises the right drivers. (The Windows device ignores the class so you need to supply the .inf file).
EDIT: Sorry, I should have been clear it would not be able to calculate that she could not take full load - I'm not sure that this is possible.
Comments
Post a Comment