Skip to main content
christophe239955_stm1_stmicro
Associate II
August 17, 2010
Question

STM32F100 enter standby mode

  • August 17, 2010
  • 3 replies
  • 841 views
Posted on August 17, 2010 at 10:41

STM32F100 enter standby mode

    This topic has been closed for replies.

    3 replies

    Nickname12657_O
    Associate III
    May 17, 2011
    Posted on May 17, 2011 at 14:02

    Hi,

    Could you please try our example

    ''STM32F10x_StdPeriph_Lib_V3.3.0\Project\STM32F10x_StdPeriph_Examples\PWR\STANDBY''  and let me know if you observe the same behavior.

    Cheers,

    STOne-32

    christophe239955_stm1_stmicro
    Associate II
    May 17, 2011
    Posted on May 17, 2011 at 14:02

    I found the problem in my code: forgot to enable the peripheral clock for the power control periphery.

    now it works!

    gil2
    Visitor II
    May 17, 2011
    Posted on May 17, 2011 at 14:02

    I've tried that example and currently do it like this:

    ...

       // Peripheral Clock - This is done in the init function, but I did it again here

       RCC_APB1PeriphClockCmd(RCC_APB1Periph_PWR,ENABLE);

      

       // Enable WKUP pin

       PWR_WakeUpPinCmd(ENABLE);

       // Insert a delay  - I have also tried without this delay

       Delay(0xFFFF);   // for(; nCount != 0; nCount--);

       // Request to enter STANDBY mode and wake up with rising edge of WKUP pin  

       PWR_EnterSTANDBYMode();

       while(1)  

       {  

         // Infinite loop - It's OK because the system will reset anyways  

       }  

    The unit does not wake up (reset).  I've tried with both the JTAG connected and not connected.

    Port PA.0 (WKUP pin) has a pull-down resistor, leading to a momentary switch, with Vcc on the other side of the switch, which should be enought to generate the required rising edge when the button is pressed.

    Thanks!