cancel
Showing results for 
Search instead for 
Did you mean: 

Idle mode works - sleep mode doesn't wake

miliatish
Associate
Posted on April 26, 2010 at 17:49

Idle mode works - sleep mode doesn't wake

2 REPLIES 2
tboss
Associate II
Posted on May 17, 2011 at 10:00

Hi,

well it´s quite late so maybe you've found your problem but anyway:

Have you enable the RTC? 

Also if your using the PLL as master clock you should change the clock source before and after sleep mode : 

SCU_MCLKSourceConfig(SCU_MCLK_RTC);

SCU_EnterSleepMode();

EXECUTE_NOP;

SCU_MCLKSourceConfig(SCU_MCLK_PLL);

I hope it helps.

Bye

miliatish
Associate
Posted on May 17, 2011 at 10:00

Yes, I figured out that I needed to call this code before entering sleep mode:

      FMI_Config(FMI_READ_WAIT_STATE_1, FMI_WRITE_WAIT_STATE_0, FMI_PWD_DISABLE, FMI_LVD_DISABLE, FMI_FREQ_LOW);

It was in the ST sample code for Application Note 2633 which I hadn't seen before (the sample code that is).

Now it's working well. My entire routine is here for anyone with the same problem (using IAR STR912-SK board for development)...

      // Enable WIU clock

      SCU_APBPeriphClockConfig(__WIU, ENABLE);

      WIU_DeInit();

      WIU_Cmd(ENABLE);

      WIU_ClearITPendingBit(WIU_Line30);            // button 2 on extint 30

      // Configure external interrupt line (sets WIU->TR & MR regs)

      WIU_StructInit(&WIU_InitStructure);

      WIU_InitStructure.WIU_Line = WIU_Line30;

      WIU_InitStructure.WIU_TriggerEdge = WIU_FallingEdge;

      WIU_Init(&WIU_InitStructure);

      // configure ext int 30 (P7.6, button 2) as wake up line

    SCU_WakeUpLineConfig(30);

      FMI_Config(FMI_READ_WAIT_STATE_1, FMI_WRITE_WAIT_STATE_0, FMI_PWD_DISABLE, FMI_LVD_DISABLE, FMI_FREQ_LOW);

    SCU_EnterSleepMode();

    asm(''nop''); asm(''nop''); asm(''nop''); asm(''nop''); asm(''nop'');

    asm(''nop''); asm(''nop''); asm(''nop''); asm(''nop''); asm(''nop'');

    asm(''nop''); asm(''nop''); asm(''nop''); asm(''nop''); asm(''nop'');