I'm trying to make our product to go into any of the low power modes of the STM32 microcontroller. That part of the code works, only I can't get the microcontroller to wake-up on the wake-up pin (PA.0). According to the datasheet the only requirement is that the pin is enabled in the 'Power control/status register (PWR_CSR)'. I've made a simple program on a development board STM3210B-EVAL. There the wake-up pin also doesn't wake the microcontroller. I've tried to use the standby example wich is supplied with the STM library, and it also will not wake-up the microcontroller.
The following code is the way I go into standby.
PWR_WakeUpPinCmd(ENABLE); PWR_EnterSTANDBYMode();
What can be the reason that the microcontroller doesn't exit the low power modes with the wake-up pin?
Mine does not wake up from STANDBY. I 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.
Any ideas? Thanks!
To be able to set the Wakeup-Pin Enable line you must enable the clock to the PWR peripheral
RCC_APB1PeriphClockCmd(RCC_APB1Periph_PWR,ENABLE); PWR_WakeUpPinCmd(ENABLE); ....
I was looking for more data-sheets, and I got this page:
http://i.imgur.com/Z1xdX.jpg
--Cpt. Vince Foster 2nd Cannon Place Fort Marcy Park, VA
As this is a question specifically about the operation of a particular microcontroller - not a Keil product - you would probably be best to ask in the manufacturer's device-specific forum.
If you do cross-post, be sure to make it clear and include links between the threads!
Note that there has been much discussion about STM32 low-power modes already on ST's STM32 forum - so you should start by reviewing that...
my.st.com/.../AllItems.aspx
View all questions in Keil forum