2014-06-25 04:00 AM
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
2014-06-27 04:21 AM
Maybe the function is wrong.
void
PWR_WakeUpPinCmd
(
FunctionalState NewState
)
void
PWR_WakeUpPinCmd
(
FunctionalState NewState)
{
/* Check the parameters */
assert_param(
IS_FUNCTIONAL_STATE(
NewState));
*
(
__IOuint32_t
*
)
CSR_EWUP_BB=
(
uint32_t
)
NewState;
}
2014-06-27 04:33 AM
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.2014-06-27 07:46 AM
sorry, maybe I explained wrong my problem
I need to exit from standby mode. there are many way to do this. Reference manualRM0090Mode 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.
2014-06-27 09:00 AM
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'2014-06-28 02:26 AM
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.2014-06-30 01:55 AM
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)
{
/* Check the parameters */
assert_param(
IS_FUNCTIONAL_STATE(
NewState));
*
(
__IOuint32_t
*
)
CSR_EWUP_BB=
(
uint32_t
)
NewState;
}
2019-01-02 06:56 PM
Did you ever figure out what the issue was?
2019-04-03 08:50 AM
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!
2022-05-04 12:05 PM
The issue was in the level of the PAx pin. It should be the same as VCC. Check your level by multimeter.