deep sleep mode issue

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

deep sleep mode issue

2,739 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by jpplus on Thu May 07 23:36:24 MST 2015
I am trying to put my 4337 into deep sleep mode and I start from the LPCopen's example of pmc_states.c (using 2.16 version from lpcopen for 4337)
when I put my board to deep sleep, it simply shuts down itself. I have serveral quesitons related to this example and general deep sleep mode.
1) I don't see __WFI() or Chip_PMC_Sleep(); be called in this example which contradicts with the data sheet.   Does this example really working?  I read a thread saying this example has bug, but need fix in latest one, but not sure 2.16 contains this fix.
2) hardware control of deep-sleep mode, I put below code and WFI(), but MCU never wake up when I trigger wakeup pin 0.  Do the hardware control of deep sleep also require all clock shutdown/off. still need enable the event router?
   LPC_PMC->PD0_SLEEP0_HW_ENA = 0x01; //M4 core
   LPC_PMC->PD0_SLEEP0_MODE = 0x003000AA;//deep sleep
   SCB->SCR = 0x04; // Set SLEEPDEEP to 1
   LPC_EVENTROUTER->SET_EN = 0xf;//wakeup pin 0-3 to wakeup
3) any working example/reference about the deep sleep mode except the pmc_states.c?

thanks
JP
Labels (1)
0 Kudos
Reply
4 Replies

2,091 Views
hmyoong
Contributor III

I am not sure if it is too late. The user manual for lpc43xx states 

12.2 General description

Remark: Before selecting the Deep-sleep mode or Power-down mode, you must select the IRC as the clock source for all output clocks through the CGU registers (see Section 13.8.1 ) and power down all PLLs.

The confusion comes because sections 12.2.3 and 12.2.4 recommended steps do not mention this. 

Also need to disable semihosting from your project.

I read further,  it is not that simple, especially for deep power down mode

a) Only 256 bytes of register starting from 0x4004 1000 is retained.

b) Need to wait awhile to fetch code from flash into memory

c) Optionally to switch back to core clock, adjust clock source, and ramp up the clock speed

c) Need to initialize to the state before you going to deep power down sleep (should store the value in flash before that mode)

d) Continue as usual 

The solution is very specific to your application. I could not find any working example from the Internet.

0 Kudos
Reply

2,091 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by henna on Sun May 31 19:07:40 MST 2015
Hi,

I am working on the similar project and I face the same issue. I am trying to put my LPC4357 into Deep power down mode and I am not able to wake up from RTC alarm event interrupt.

However I am able to wake up from wake up 0 event interrupt.

To make sure RTC alarm is triggered I am putting ON one LED in the interrupt.the VBAT pin stays at 3.3V all the time and I put debug to check if RTC is enabling or not, everything works fine but, if I put my 4357 in deep power down mode and choose to wake up from RTC alarm event interrupt I loose the control of debug( which is expected) but by I never get RTC alarm interrupt.

I suspect RTC is not working( or is not getting power) as expected in deep power down mode.

Can anyone tell what I am doing wrong or any help about how to check power of RTC domain once the core is deep power down.

Any help will be appreciated.

Thanks,
Heena
0 Kudos
Reply

2,091 Views
danieltoma
Contributor I

Hi,

Did you manage to use the RTC alarm to wake in deep sleep or power down mode?

Regards,

Daniel

0 Kudos
Reply

2,091 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by mc on Fri May 08 09:31:19 MST 2015
Hi jplus,
Could you please modify Chip_PMC_Set_PwrState function in LPCOpen and try again?

void Chip_PMC_Set_PwrState(CHIP_PMC_PWR_STATE_T PwrState)
{

/* Set Deep sleep mode bit in System Control register of M4 core */

        LPC_PMC->PD0_SLEEP0_HW_ENA |=(1<<0)|(1<<1);
      /* Set power state in PMC */
        LPC_PMC->PD0_SLEEP0_MODE = (uint32_t) PwrState;

     __WFI();
}
0 Kudos
Reply