EP9315 EP9312 EP9307(EP9302/01没测试过)系统若不按照如下的方式做,可能会出现的情况:<br /><br /> 当系统未启动时,插上USB设备(U盘、鼠标、键盘、wifi模块等)系统上电后识别不到USB设备,只有把这些设备重新拔一次才能重新识别到。<br /><br />出现这个想象的原因是:微软PB4.2/5.0系统的问题,与cirrus无关系。<br /><br /><br />解决办法:<br /><br />The file describes the cause and the fix of Windows CE 5.0's USB device <br />detection problem during power-up. <br /><br />1. USB Device Detection Problem during Powering-Up:<br /><br /> - Connect USB devices to EDB93xx's USB ports when the board is <br /> powered-off.<br /> - Power on EDB93xx.<br /> - Wait until CE 5.0 is fully loaded.<br /> - One or several USB devices are not detected by CE 5.0.<br /><br /><br />2. The Cause:<br /><br /> In USB's Open Host Controller Interface (OHCI) Specification, in <br /> Register HcRhDescriptorA (EP93xx address 0x80020048), Bits 24-31 <br /> are PowerOnToPowerGoodTime. This POTPGT byte specifies the duration<br /> Host Controller Driver has to wait before accessing a powered-on port<br /> of the Root Hub. It is implementation-specific. The unit of time <br /> is 2 msec. The duration is calculated as POTPGT x 2msec.<br /><br /> EP93xx's default value of Register HcRhDescriptorA is 0x02001203. <br /> The value of the POTPGT byte is 0x02. 2*2msec=4msec. It needs 4 msec <br /> delay after the Host Controller has supplied power to the Root Hub.<br /> <br /> The start-up sequence for EDB93xx's USB host controller should be<br /><br /> 1. Host Controller supplies power to the Root Hub.<br /> 2. Delay 4 msec.<br /> 3. Set Host Controller to Operational state. Access USB ports. Start <br /> to send SOF tokens...etc.<br /><br /> CE 5.0's USB driver doesn't implement the code to read the HcRhDescriptorA<br /> register and deploy the required delay. <br /> <br /> <br />3. The Fix: <br /> <br /> Add the 4-msec delay to CE's USB host driver then rebuild the platform.<br /><br /> Modify the file:<br /> WINCE500\PUBLIC\COMMON\OAK\DRIVERS\USB\HCD\OHCD2\chw.cpp<br /> Please look at the code "//QQQQQ" below.<br /><br /><br />BOOL CHW::Initialize(void)<br />{<br />..................<br /> InterruptDisable( m_dwSysIntr ); // Just to make sure this is really ours.<br /> // Initialize Interrupt. When interrupt id # m_sysIntr is triggered,<br /> // m_hUsbInterruptEvent will be signaled. Last 2 params must be NULL<br /> if ( !InterruptInitialize( m_dwSysIntr, m_hUsbInterruptEvent, NULL, NULL) )<br />{<br /> DEBUGMSG(ZONE_ERROR, (TEXT("-CHW::Initialize. Error on<br />InterruptInitializern")));<br /> return FALSE;<br /> }<br /><br /> // Apply power to all root hub ports, just like OHCI.<br /> m_portBase->HcRhDescriptorA.NPS = 1;<br /> m_portBase->HcRhStatus.reg= HcRegisters::HcRhStatus::LPSC;<br /><br />//QQQQQQQ Add 4msec delay that is required by Host Controller.<br />Sleep(4); <br /> <br /> // Start up our IST - the parameter passed to the thread<br /> // is unused for now<br /> DEBUGCHK( m_hUsbInterruptThread == NULL &&<br /> m_fUsbInterruptThreadClosing == FALSE );<br /> m_hUsbInterruptThread = CreateThread( 0, 0, UsbInterruptThreadStub, this, 0,<br />NULL );<br /> if ( m_hUsbInterruptThread == NULL ) {<br /> DEBUGMSG(ZONE_ERROR, (TEXT("-CHW::Initialize. Error creating<br />ISTn")));<br /> return FALSE;<br /> }<br /> CeSetThreadPriority( m_hUsbInterruptThread, g_IstThreadPriority );<br />......................<br />}<br /><br /> <br /> 相关链接:<a href='http://www.embedall.com'>http://www.embedall.com</a> |
|