阅读:2468回复:9
开发过usb上位机驱动的大虾请看一下(附图)
win2000+ddk+windriver,插入usb总线以后,发现新硬件,提示安装驱动,我把我的sys和inf文件目录指定以后,提示说找不到sys文件。
我按照提示所缺少的文件,修改了sys的名字,就完成了驱动的安装,不知道这样行不行啊??? |
|
沙发#
发布于:2005-06-29 14:34
我跟踪了一下断点,发现在主机发送设置配置请求这个阶段出现问题。其中,主机发过来的请求包我也已经正确接受,数据为00 09 01 00 00 00 00 00,但是不知怎么回事,就是过不去???这个过程应该是发现了USB设备,要求安装驱动,对不对???
如果是这样的话,就是我的驱动没有编写正确?? 谁能给我一些建议啊??? |
|
板凳#
发布于:2005-06-29 15:33
这次郁闷大了!!!原来以为用driverstudio写usb驱动很容易,只要按照wizard一步一步做就可以了,哪知道。。。。今天我修改了我程序中的vendor id(0471) product id(0666),然后将周立功的d12test.sys及其inf文件安装上去!!!结果,请看下图:
|
|
地板#
发布于:2005-06-29 15:45
这么难吗?说明我也是新手。我试过可以的。看看这个资料吧。
![]() |
|
|
地下室#
发布于:2005-06-29 17:02
这个问题是你的固件有问题,枚举还没有完成固件就出错了当然会有"安装驱动出错"提示了,你回去好好好看看固件吧,这个问题我遇到过N回,判断应该是没错的.
|
|
5楼#
发布于:2005-06-30 14:29
我不太明白你的意思,既然主机已经检测到我的usb设备,提示我安装驱动,那么说明我在00 09 01 00 00 00 00 00 之前的程序应该都是正确的,而我现在按照ddk+vc+driverstudio编写的sys和inf文件就是通不过,真是搞不懂,到底我还忽略了那个方面。
;~~~~~~~~~~~~~~~~~~~~~~~~~~~ ;设备描述符 ;~~~~~~~~~~~~~~~~~~~~~~~~~~~ TAB_DEVICE_DESCRIPTOR: DB 12H ;size of descriptor DB 01H ;device descriptor type DB 10H,01H ;usb specification DB 0DCH ;device class DB 00H ;deivice sub class DB 00H ;device protocol DB 10H ;MAX packet size DB 071H,04H ;id vendor C4H,07H, 5EH,04H DB 66H,06H ;product ID 00H, 0A4H DB 00H,01H ;device release 13H,01H DB 00H ;index of manufacture string DB 00H ;index of product string DB 00H ;serial number of string DB 01H ;Nomber of possible configration ;~~~~~~~~~~~~~~~~~~~~~~~~~~~ TAB_Configration_Descriptor: DB 09H ;Blength DB 02H ;descripter type DB CON_Descripter_Total_length,00H ;total length--2EH DB 01H ;number of interface DB Con_configration_Value ;configration Value--01H DB 00H ;configration string index DB 040H ;attributes--自供电方式 DB 32H ;max power ;~~~~~~~~~~~~~~~~~~~~~~~~~~~ TAB_Interface_Descriptor: DB 09H ;length DB 04H ;descriptor type DB 00H ;interface number DB 00H ;alternate setting DB 04H ;number of endpoint DB 0DCH ;interface class DB 0A0H ;interface sub class DB 0B0H ;interface protocol DB 00H ;interface index ;~~~~~~~~~~~~~~~~~~~~~~~~~~~ TAB_Endpoint1_output: DB 07H ; length DB 05H ; descripter type DB 81H ; endpoint address output addr=81 DB 02H ; mattributes DB 10H,00H ; max packet size DB 10H ; interval ;~~~~~~~~~~~~~~~~~~~~~~~~~~~ TAB_Endpoint1_input: DB 07H ; length DB 05H ; descripter type DB 01H ; endpoint address input addr=01 DB 02H ; mattributes DB 10H,00H ; max packet size DB 10H ; interval ;~~~~~~~~~~~~~~~~~~~~~~~~~~~ TAB_Mainoint_output: DB 07H ; length DB 05H ; descripter type DB 82H ; endpoint address output addr=82 DB 02H ; mattributes 02H ÅúÁ¿´«Êä DB 40H,00H ; max packet size DB 10H ; interval ;~~~~~~~~~~~~~~~~~~~~~~~~~~~ TAB_Mainoint_input: DB 07H ; length DB 05H ; descripter type DB 02H ; endpoint address input addr=02 DB 02H ; mattributes 02H ÅúÁ¿´«Êä DB 40H,00H ; max packet size DB 10H ; interval 根据这些描述符,我在编写驱动的时候,设置如图: 在IOCTL上添加了一个测试函数,加入的代码 PURB pUrb=m_Lower.BuildVendorRequest( NULL, 0, 0, 0, 0 ); status=m_Lower.SubmitUrb(pUrb,NULL,NULL,5000L); |
|
6楼#
发布于:2005-06-30 14:40
我个人认为,IOCTL的函数生成了一个空的框架,向里面添加不添加代码应该不影响我的整个枚举过程,但是,不管我是否添加IOCTL,都是一个结果:windows无法为这个设备找到一个驱动!!!
我最终怀疑是我的设备描述付的问题,所以把描述符贴出来,希望大家多多帮忙啊!! |
|
7楼#
发布于:2005-06-30 15:54
说的好,自己试试好了,现在好好研究一下,到底为什么。为什么你不把IOCTL填加好在测试一下呢。呵呵。
|
|
|
8楼#
发布于:2005-07-02 14:01
ding
|
|
9楼#
发布于:2005-07-05 07:56
虽然看不明白,还是顶一个
|
|