我正在为x86 平台上的 Windows CE 6 开发 USB 驱动程序。
如果在系统初始化期间插入 USB,我将面临 USB 驱动程序初始化问题。
通常我在系统启动后插入 USB 并且 USB 驱动程序读取批量端点最大数据包大小为 512 字节并且驱动程序成功初始化。调试输出:(在成功初始化的情况下)
+USBD:OpenPipe, EP: 0x81, MaxPkt: 512, Type: Bulk -USBD:OpenPipe success, hPipe = D19A9000 +USBD:OpenPipe, EP: 0x82, MaxPkt: 512, Type: Bulk -USBD:OpenPipe success, hPipe = D19A98C0 +USBD:OpenPipe, EP: 0x83, MaxPkt: 512, Type: Bulk -USBD:OpenPipe success, hPipe = D19A1480 +USBD:OpenPipe, EP: 0x84, MaxPkt: 64, Type: Interrupt -USBD:OpenPipe success, hPipe = D19A1F60 +USBD:OpenPipe, EP: 0x1, MaxPkt: 512, Type: Bulk -USBD:OpenPipe success, hPipe = D19A5680 +USBD:OpenPipe, EP: 0x2, MaxPkt: 512, Type: Bulk -USBD:OpenPipe success, hPipe = D19A5D20 +USBD:OpenPipe, EP: 0x3, MaxPkt: 512, Type: Bulk -USBD:OpenPipe success, hPipe = D19A6500 +USBD:OpenPipe, EP: 0x4, MaxPkt: 512, Type: Bulk -USBD:OpenPipe success, hPipe = D19A74E0 +USBD:OpenPipe, EP: 0x5, MaxPkt: 512, Type: Bulk -USBD:OpenPipe success, hPipe = D19A7940
但问题是在系统初始化期间插入 USB 时,USB 驱动程序读取批量端点的最大数据包大小为 64 字节(也有一些无可用内存打印)并且初始化失败。调试输出:(初始化失败案例)
+USBD:OpenPipe, EP: 0x81, MaxPkt: 64, Type: Bulk -USBD:OpenPipe success, hPipe = D051A200 +USBD:OpenPipe, EP: 0x82, MaxPkt: 64, Type: Bulk -USBD:OpenPipe success, hPipe = D051AB00 +USBD:OpenPipe, EP: 0x83, MaxPkt: 64, Type: Bulk -USBD:OpenPipe success, hPipe = D05120E0 +USBD:OpenPipe, EP: 0x84, MaxPkt: 64, Type: Interrupt -USBD:OpenPipe success, hPipe = D051B3C0 +USBD:OpenPipe, EP: 0x1, MaxPkt: 64, Type: Bulk -USBD:OpenPipe success, hPipe = D051BD80 +USBD:OpenPipe, EP: 0x2, MaxPkt: 64, Type: Bulk -USBD:OpenPipe success, hPipe = D051C1C0 +USBD:OpenPipe, EP: 0x3, MaxPkt: 64, Type: Bulk -USBD:OpenPipe success, hPipe = D051C600 +USBD:OpenPipe, EP: 0x4, MaxPkt: 64, Type: Bulk -USBD:OpenPipe success, hPipe = D051CA40 +USBD:OpenPipe, EP: 0x5, MaxPkt: 64, Type: Bulk -USBD:OpenPipe success, hPipe = D051CE80 CPhysMem AllocateMemory : No memory available CPipe(Bulk)::IssueTransfer - no memory for TD buffer
而且我看到所有 USB 传输都失败了。
CQueuedPipe(Bulk)::CheckForDoneTransfers - TD 0xd06759a0 失败,地址 = 1,端点 = 2,errorCounter = 0,状态字段 = 0x22 CQueuedPipe(Control)::CheckForDoneTransfers - TD 0xd067f600 失败,地址 = 1,端点 = 0, errorCounter = 0,状态字段 = 0
任何人都可以帮助我解决这个问题,为什么它在系统初始化期间读取不同长度的批量端点?