Hi

I am stuck with one Problem. First let me tell you about my
environment. I am using Intex PXA270 Processor & Mainstoneiii USB
function driver code using wince 5.0.

USB client driver is working Fine after hardreset even it is working
fine on the cable attach/Detach event.

But when i suspend the System & resume the System it is not working. I
have corrected the Powerup function:

void BulUsbDevice::PowerUp()
{
m_fResumeOccurred = TRUE;
if (m_CurPowerState == PwrDeviceUnspecified) {
PowerMgr(FALSE) ;
}
PowerMgr(FALSE) ;
}

Powerdown function:

void BulUsbDevice::PowerDown()
{
if (m_CurPowerState == PwrDeviceUnspecified) {
PowerMgr(TRUE) ;
}
PowerMgr(TRUE) ;

}

BOOL BulUsbDevice::ReInit() // For Cable Detach & Attach , We have to
re-init the Device Controller.
{
Lock();

HardwareInit();
for (DWORD dwIndex=0; dwIndex<MAX_ENDPOINT_NUMBER; dwIndex++) {
BulEndpoint *pEndpoint = ObjectIndex(dwIndex);
if (pEndpoint!=NULL) {
pEndpoint->ReInit();
pEndpoint->DeRef();
}
}

I have tried all the Possible Option but it is still not working . is
this Know issues ?

Please see the below debug logs after Resume the system :

----->BulUsbDevice::HardwareInit - Called
----->BulEndpointZero::ReInit - Called
----->BulEndpoint::ReInit - Called
----->BulEndpoint::ReInit - Called
----->BulUsbDevice::ReInit - Called
----->BulUsbDevice::SetPowerState - Called
----->BulEndpoint::ThreadRun - ThreadRun ThreadRun
----->BulUsbDevice::HardwareInit - Called
----->BulEndpointZero::ReInit - Called
----->BulEndpoint::ReInit - Called
----->BulEndpoint::ReInit - Called
----->BulUsbDevice::ReInit - Called
----->BulEndpoint::ThreadRun - Called
----->BulEndpoint::ThreadRun - Reset Detected

Does anybody have the same Proble ?

Thanks.
Rakesh.

Re: Usb client driver is not working after suspend resume by John

John
Wed May 17 13:35:05 CDT 2006

Since I did not have the same hw logic like Mainstone board does, I had the
same issue with you.

I was able to fix the issue with adding some lines of code in DWORD
BulUsbDevice::ThreadRun().

You can use dwIntr1Status and m_fIsCableAttached.

If dwIntr1Status is Resume, then you can call ReInit() as usb cable plug-in.

If dwIntr1Status is Suspend, then you can set the status as usb unplug.

You can set m_fIsCableAttached as FALSE in Power off function.

I hope this might help you a little bit.

John Baik



<rakeshzalavadiya@gmail.com> wrote in message
news:1147862844.137365.116010@j55g2000cwa.googlegroups.com...
> Hi
>
> I am stuck with one Problem. First let me tell you about my
> environment. I am using Intex PXA270 Processor & Mainstoneiii USB
> function driver code using wince 5.0.
>
> USB client driver is working Fine after hardreset even it is working
> fine on the cable attach/Detach event.
>
> But when i suspend the System & resume the System it is not working. I
> have corrected the Powerup function:
>
> void BulUsbDevice::PowerUp()
> {
> m_fResumeOccurred = TRUE;
> if (m_CurPowerState == PwrDeviceUnspecified) {
> PowerMgr(FALSE) ;
> }
> PowerMgr(FALSE) ;
> }
>
> Powerdown function:
>
> void BulUsbDevice::PowerDown()
> {
> if (m_CurPowerState == PwrDeviceUnspecified) {
> PowerMgr(TRUE) ;
> }
> PowerMgr(TRUE) ;
>
> }
>
> BOOL BulUsbDevice::ReInit() // For Cable Detach & Attach , We have to
> re-init the Device Controller.
> {
> Lock();
>
> HardwareInit();
> for (DWORD dwIndex=0; dwIndex<MAX_ENDPOINT_NUMBER; dwIndex++) {
> BulEndpoint *pEndpoint = ObjectIndex(dwIndex);
> if (pEndpoint!=NULL) {
> pEndpoint->ReInit();
> pEndpoint->DeRef();
> }
> }
>
> I have tried all the Possible Option but it is still not working . is
> this Know issues ?
>
> Please see the below debug logs after Resume the system :
>
> ----->BulUsbDevice::HardwareInit - Called
> ----->BulEndpointZero::ReInit - Called
> ----->BulEndpoint::ReInit - Called
> ----->BulEndpoint::ReInit - Called
> ----->BulUsbDevice::ReInit - Called
> ----->BulUsbDevice::SetPowerState - Called
> ----->BulEndpoint::ThreadRun - ThreadRun ThreadRun
> ----->BulUsbDevice::HardwareInit - Called
> ----->BulEndpointZero::ReInit - Called
> ----->BulEndpoint::ReInit - Called
> ----->BulEndpoint::ReInit - Called
> ----->BulUsbDevice::ReInit - Called
> ----->BulEndpoint::ThreadRun - Called
> ----->BulEndpoint::ThreadRun - Reset Detected
>
> Does anybody have the same Proble ?
>
> Thanks.
> Rakesh.
>



Re: Usb client driver is not working after suspend resume by rakeshzalavadiya

rakeshzalavadiya
Thu May 18 02:26:28 CDT 2006

Hi John Baik,

Thanks for your reply. I do not know something is wrong in my Hardware
but i am not getting USB Suspend/Resume interrupt after suspend/resume
the system.

USB suspend & Resume interrupt is Coming fine after Hard reset.

I have tried your solution but i was never reach in to the Resume
interrupt after suspend/resume the system.

Do you have any more ideas ..?

Thanks.
Rakesh.


Re: Usb client driver is not working after suspend resume by SergeiR

SergeiR
Thu May 18 12:18:22 CDT 2006

What exactly is the symptom ? PC detects the device and says unrecognized
device ? Or no detection at all ? For the latter one check D- and D+ signals
on your connector, are they alive after resume or not ?

Sincerely
SergeiR

<rakeshzalavadiya@gmail.com> wrote in message
news:1147862844.137365.116010@j55g2000cwa.googlegroups.com...
> Hi
>
> I am stuck with one Problem. First let me tell you about my
> environment. I am using Intex PXA270 Processor & Mainstoneiii USB
> function driver code using wince 5.0.
>
> USB client driver is working Fine after hardreset even it is working
> fine on the cable attach/Detach event.
>
> But when i suspend the System & resume the System it is not working. I
> have corrected the Powerup function:
>
> void BulUsbDevice::PowerUp()
> {
> m_fResumeOccurred = TRUE;
> if (m_CurPowerState == PwrDeviceUnspecified) {
> PowerMgr(FALSE) ;
> }
> PowerMgr(FALSE) ;
> }
>
> Powerdown function:
>
> void BulUsbDevice::PowerDown()
> {
> if (m_CurPowerState == PwrDeviceUnspecified) {
> PowerMgr(TRUE) ;
> }
> PowerMgr(TRUE) ;
>
> }
>
> BOOL BulUsbDevice::ReInit() // For Cable Detach & Attach , We have to
> re-init the Device Controller.
> {
> Lock();
>
> HardwareInit();
> for (DWORD dwIndex=0; dwIndex<MAX_ENDPOINT_NUMBER; dwIndex++) {
> BulEndpoint *pEndpoint = ObjectIndex(dwIndex);
> if (pEndpoint!=NULL) {
> pEndpoint->ReInit();
> pEndpoint->DeRef();
> }
> }
>
> I have tried all the Possible Option but it is still not working . is
> this Know issues ?
>
> Please see the below debug logs after Resume the system :
>
> ----->BulUsbDevice::HardwareInit - Called
> ----->BulEndpointZero::ReInit - Called
> ----->BulEndpoint::ReInit - Called
> ----->BulEndpoint::ReInit - Called
> ----->BulUsbDevice::ReInit - Called
> ----->BulUsbDevice::SetPowerState - Called
> ----->BulEndpoint::ThreadRun - ThreadRun ThreadRun
> ----->BulUsbDevice::HardwareInit - Called
> ----->BulEndpointZero::ReInit - Called
> ----->BulEndpoint::ReInit - Called
> ----->BulEndpoint::ReInit - Called
> ----->BulUsbDevice::ReInit - Called
> ----->BulEndpoint::ThreadRun - Called
> ----->BulEndpoint::ThreadRun - Reset Detected
>
> Does anybody have the same Proble ?
>
> Thanks.
> Rakesh.
>



Re: Usb client driver is not working after suspend resume by rakeshzalavadiya

rakeshzalavadiya
Thu May 18 21:35:15 CDT 2006

Hi SergeiR,

Thanks for your reply.USB Client is Working Fine in all the case except
suspend/resume.
Here is the Flow :

On Hardreset --- USB Client is Working.
On suspend the system & Resume the System - USB Clinet is not detected
at the HOST side & PC says unrecognized device.

My USB Connector signal when i suspend the System is as Give Below:

D+ -- 0 Volt
D- -- 0 Volt
1. +5 Volt
4. 0 Volt.

My USB Connector signal when i Resume the System is as Give Below:

D+ -- 3.10 Volt
D- -- 0 Volt
1. + 5 Volt
4. 0 Volt.

My USB Connector signal when i Detach the USB Cable without suspend
the system is as Give Below:

D+ -- 3.50 Volt
D- -- 0.3 Volt
1. 0 Volt
4. 0 Volt.

Thanks,
Rakesh.


Re: Usb client driver is not working after suspend resume by SergeiR

SergeiR
Fri May 19 12:41:45 CDT 2006

After resume occurred, go check using kernel debugger and a scope, are there
usb data packets going back and forth the same way, as after insertion of
usb cable (a process of negotiations, which seems not to happen in your
case). It looks like upon wakeup your device doesn't re-negotiate connection
with PC (hence unrecognized device). It may be only send one packet and does
not provide its identity to PC, which should be sent in subsequent packets.

Does your platform have pull up resistors for D- on main processor chip or
it is using external chip to drive D data lines ? If the latter, go check
that the external circuit is being re-enabled after resume.

SergeiR

<rakeshzalavadiya@gmail.com> wrote in message
news:1148006115.447149.52950@i40g2000cwc.googlegroups.com...
> Hi SergeiR,
>
> Thanks for your reply.USB Client is Working Fine in all the case except
> suspend/resume.
> Here is the Flow :
>
> On Hardreset --- USB Client is Working.
> On suspend the system & Resume the System - USB Clinet is not detected
> at the HOST side & PC says unrecognized device.
>
> My USB Connector signal when i suspend the System is as Give Below:
>
> D+ -- 0 Volt
> D- -- 0 Volt
> 1. +5 Volt
> 4. 0 Volt.
>
> My USB Connector signal when i Resume the System is as Give Below:
>
> D+ -- 3.10 Volt
> D- -- 0 Volt
> 1. + 5 Volt
> 4. 0 Volt.
>
> My USB Connector signal when i Detach the USB Cable without suspend
> the system is as Give Below:
>
> D+ -- 3.50 Volt
> D- -- 0.3 Volt
> 1. 0 Volt
> 4. 0 Volt.
>
> Thanks,
> Rakesh.
>