cancel
Showing results for 
Search instead for 
Did you mean: 

Wakeup from standby with Wakeup Pin

jeucojeuco
Associate II
Posted on June 25, 2014 at 13:00

I want know if is possible to wakeup the MCU(STM32F4) fromstandby power mode with only the Wakeup pin, without setting the RTC allarm.

i have try this but the MCU don't wakeup.

HAL_EnableDBGStandbyMode();
HAL_PWR_DisableWakeUpPin( PWR_WAKEUP_PIN1 );
__HAL_PWR_CLEAR_FLAG(PWR_FLAG_WU); 
/* Enable WKUP pin */
HAL_PWR_EnableWakeUpPin(PWR_WAKEUP_PIN1);
/* Request to enter STANDBY mode (Wake Up flag is cleared in HAL_PWR_EnterSTANDBYMode function) */
HAL_PWR_EnterSTANDBYMode();

if i use the ST example code with wakeup from Pin or RTC allarm the mcu wakeup correctly, so i don't think there are hardware problem. #standby-wakeup-pin
11 REPLIES 11
chen
Associate II
Posted on June 27, 2014 at 13:33

Hi

I think you have not understood what 'wakeup pin' is.

There is NO IO pin called 'wake up'

You can associate any IO pin to an EXTI interrupt (IRQ).

(You should define a default ISR for this, it does not need to do anything)

Then you can make the STM32 wake on any IRQ.

jeucojeuco
Associate II
Posted on June 27, 2014 at 16:46

sorry, maybe I explained wrong my problem

I need to exit from standby mode. there are many way to do this. Reference manualRM0090

Mode exit WKUP pin rising edge, RTC alarm (Alarm A and Alarm B), RTC wakeup,
tamper event, time stamp event, external reset in NRST pin, IWDG reset.

the pin Wakeup exist, the right name is ''WKUP pin'', and it is on PA0, isn't impossible to configure on any IO as you say.
chen
Associate II
Posted on June 27, 2014 at 18:00

Hi

''the pin Wakeup exist, the right name is ''WKUP pin'', and it is on PA0,''

I stand corrected - PA0 can be used a 'Wakeup'. (my appologies)

The reference manual says it is an 'Additional Function' - usually this means you have to set the IO port pin to Analogue input. Please check the reference manual for details on how to configure PA0 to 'wakeup'

'' isn't impossible to configure on any IO as you say.''

I did not mean 'wakeup'

I was referein to 'EXTI' - external interrupt

It is possible to make any of the IO pins an external interrupt source when the pin is an input.

Any interrupt can wake the processor from 'sleep' mode.

This does not work for Standby mode.

Standby mode is the hardest one to work with/recover from.

Exit from Standby mode is not far from recovering from a reset

''All registers are reset after wakeup from Standby except for PWR power

control/status register''

''After waking up from Standby mode, program execution restarts in the same way as after a Reset''

If you are not familiar with the low power modes - start with 'Sleep mode' - it is the easiest one to get right.

With peripheral clock gating - you can get very low power consumption without having to deal with the problems of 'Standby mode'

jeucojeuco
Associate II
Posted on June 28, 2014 at 11:26

Tks for usefull info, to someone can help, but not answer to my question.

I don't think is necessary to set WKUP pin to analog, when it enter in stanby mode the registers contents are lost, this is clear otherwize how is possible to have low power with the keeping of all the registers. Only RTC registers, RTC backup register, backup SRAM and PWR register are keeping.

Tks for the suggest but i'm already use the Sleep mode when the code is in Idle State, i need Standby mode for the lowest possible power.

chen
Associate II
Posted on June 30, 2014 at 10:55

Hi

Sorry you feel that I am not helping you.

To enable and use the WKUP pin PA0 - you must set the EWUP bit (bit 8) in

PWR power control/status register (PWR_CSR).

The reference manual does not specify what to set the port pin to (input, output or analogue).

''All registers are reset after wakeup from Standby except for PWR power

control/status register''

This quote is from the reference manual RM0090. If you have found that the statement is incomplete (or wrong) please let ST know.

void

 

PWR_WakeUpPinCmd

(

FunctionalState NewState

)

http://www.das-labor.org/trac/browser/microcontroller/src-stm32f4xx/serialUSB/Libraries/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_pwr.c?rev=5630&desc=1#L241

{

http://www.das-labor.org/trac/browser/microcontroller/src-stm32f4xx/serialUSB/Libraries/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_pwr.c?rev=5630&desc=1#L242

  

/* Check the parameters */

 

http://www.das-labor.org/trac/browser/microcontroller/src-stm32f4xx/serialUSB/Libraries/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_pwr.c?rev=5630&desc=1#L243

  assert_param

(

IS_FUNCTIONAL_STATE

(

NewState

));

http://www.das-labor.org/trac/browser/microcontroller/src-stm32f4xx/serialUSB/Libraries/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_pwr.c?rev=5630&desc=1#L244

http://www.das-labor.org/trac/browser/microcontroller/src-stm32f4xx/serialUSB/Libraries/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_pwr.c?rev=5630&desc=1#L245

  

*

(

__IO 

uint32_t

 

*

)

 CSR_EWUP_BB 

=

 

(

uint32_t

)

NewState

;

http://www.das-labor.org/trac/browser/microcontroller/src-stm32f4xx/serialUSB/Libraries/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_pwr.c?rev=5630&desc=1#L246

}

Albert Aviles
Associate

Did you ever figure out what the issue was?​

MHein
Associate II

In the Datasheets of the STM32L4xx, its advertised quite big, that there are Wakeup Pins to wake up from different Low Power Modes:

Features

• Ultra-low-power with FlexPowerControl

– 1.71 V to 3.6 V power supply

– -40 °C to 85/125 °C temperature range

– 145 nA in VBAT mode: supply for RTC and

32x32-bit backup registers

– 22 nA Shutdown mode (5 wakeup pins)

– 106 nA Standby mode (5 wakeup pins)

....

....

Now, when developers try to use those Pins, there is pretty much no information nowhere!

So it would be highly apreachiated, if someone could explain correctly and post some example code on how to actuelly implement those 22nA and 106 nA shutdown modes with PIN wakeup! Otherwise, ST should not advertise that way! Thank you!

by the way:

All links above go nowhere!

AStal.1
Associate

The issue was in the level of the PAx pin. It should be the same as VCC. Check your level by multimeter.