Page 1 of 1

WINCE WAKEUP from SUSPEND

Posted: Fri May 08, 2009 1:30 pm
by bob
Hi,
I have a problem with the suspend wake-up procedure. I'm using the sam9263 with wince 6.0R2. I'm using a key button to wake-up the system.
I put in suspend mode the system using the menu start->suspend,
1) if I wake-up the system in about 30 seconds everything works fine
2) if I wake-up the system after 30 seconds the system hangs
KeyPadPowerOff customclass
KeyPadPowerOff
resetting RTT to delay rollover
BSPPowerOff
+SOCSaveAndDisableAllIntrBeforeSuspend()
SOCPioSaveAndDisableAllIntrBeforeSuspend()
+SOCPioControllerIntrEnable()
OALPowerWakeSource enable 17

SUSPEND CPU

+SOCRestoreAllIntrAfterSuspend()
+SOCPioRestoreAllIntrAfterSuspend()
BSPPowerOn
-----system hangs -----

any idea? (I have disabled all the timers in the PM power module)
thanks

Re: WINCE WAKEUP from SUSPEND

Posted: Mon Feb 08, 2010 4:30 am
by ianscriven
Hi,

Did you ever figure this out? I'm experiencing the same problem at the moment.

Re: WINCE WAKEUP from SUSPEND

Posted: Tue Feb 09, 2010 5:18 am
by guangyu.ren
This could be due to the data loss in SDRAM during suspend period.
To confirm it, you can try disabling all the SDRAM and PMC configure code in PLATFORM\AT91SAM9263EK\SRC\OAL\OALLIB\asmpower.s to let SDRAM and all the clock run as normal during suspend.

And see whether you still have this problem or not.

Re: WINCE WAKEUP from SUSPEND

Posted: Tue Jul 27, 2010 6:22 am
by uma_crlbel
Dear Sir,

Can you please post the stps which you have followd to solve this issue.

With regards,
uma

Re: WINCE WAKEUP from SUSPEND

Posted: Fri Jul 30, 2010 12:48 am
by ianscriven
This is my BSPPowerOff function (in platform/at91sam9263ek/src/oal/oallip/power.c) - I think this the change I made to make it work (it was a while ago)...

Code: Select all

VOID BSPPowerOff(DWORD *pdwSavePCConfig, DWORD *pdwSaveSCConfig)
{
	AT91PS_PMC pPMC = OALPAtoVA((DWORD)AT91C_BASE_PMC,FALSE);
	AT91PS_SDRAMC pSDRAM = OALPAtoVA((DWORD)AT91C_BASE_SDRAMC0,FALSE);

	RETAILMSG(1,(TEXT("BSPPowerOff\r\n")));
	// Save the settings in order to restore them after a resume
	*pdwSavePCConfig = pPMC->PMC_PCSR;
	*pdwSaveSCConfig = pPMC->PMC_SCSR;

	pSDRAM->SDRAMC_LPR = AT91C_SDRAMC_LPCB_SELF_REFRESH;

	//stop unecessary clock
	// The PIOC should be awake for resume, PIOA maybe for the Touschscreen IRQ
	// For the others three, poweroff should be implemented in the driver code, in order to correctly manage the poweroff
	//pPMC->PMC_PCDR = ~((1 << AT91C_ID_PIOCDE) | (1 << AT91C_ID_PIOA) | (1 << AT91C_ID_AC97C) | (1 << AT91C_ID_2DGE) | (1 << AT91C_ID_EMAC) | (1 << AT91C_ID_US0) | (1 << AT91C_ID_DMA ));		//0xFF5BFFEB
	pPMC->PMC_PCDR = ~((1 << AT91C_ID_PIOA) | (1 << AT91C_ID_2DGE));		//0xFF5BFFEB
	//pPMC->PMC_SCDR = ~(AT91C_PMC_PCK);
	pPMC->PMC_SCDR = 0xFFFFFFFF;
}
The last bit (stop unecessary clock...) will probably be different for your system or the eval board, so I'd just leave it as the default. The two pSDRAM lines are the ones that matter.

Re: WINCE WAKEUP from SUSPEND

Posted: Fri Jul 30, 2010 5:21 am
by uma_crlbel
Thanks for the reply sir,

I could do it.

This is my BSPPowerOff:

VOID BSPPowerOff(DWORD *pdwSavePCConfig, DWORD *pdwSaveSCConfig)
{
AT91PS_PMC pPMC = OALPAtoVA((DWORD)AT91C_BASE_PMC,FALSE);

// UMA 27-07-10
AT91PS_SDRAMC pSDRAM = OALPAtoVA((DWORD)AT91C_BASE_SDRAMC0,FALSE);

RETAILMSG(1,(TEXT("BSPPowerOff\r\n")));
// Save the settings in order to restore them after a resume
*pdwSavePCConfig = pPMC->PMC_PCSR;
*pdwSaveSCConfig = pPMC->PMC_SCSR;

//stop unecessary clock
// The PIOC should be awake for resume, PIOA maybe for the Touschscreen IRQ
// For the others three, poweroff should be implemented in the driver code, in order to correctly manage the poweroff

pPMC->PMC_PCDR = ~((1 << AT91C_ID_PIOCDE) | (1 << AT91C_ID_PIOA) | (1 << AT91C_ID_AC97C) | (1 << AT91C_ID_2DGE) | (1 << AT91C_ID_EMAC)); //0xFF5BFFEB
pPMC->PMC_SCDR = ~(AT91C_PMC_PCK);

// UMA 27-07-10
//Put SDRAM in SELF_REFRESH mode
pSDRAM->SDRAMC_LPR = AT91C_SDRAMC_LPCB_SELF_REFRESH | AT91C_SDRAMC_TIMEOUT_128_CLK_CYCLES;

}


Thankyou verymuch.