2010-04-26 08:49 AM
Idle mode works - sleep mode doesn't wake
2011-05-17 01:00 AM
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
2011-05-17 01:00 AM
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'');