Skip to main content
varo1111
Associate
August 27, 2020
Solved

Waking up from stand-by mode with both rising and falling edge on wakeup pin.

  • August 27, 2020
  • 1 reply
  • 1406 views

I have a STM32G030K6T.

Right now I can wake up from standby with either wake up pin falling or rising edge. How can I use both of these edges to wake up the device from stand-by?

HAL_PWR_EnableWakeupPin documentation says

/**

 * @brief Enable the WakeUp PINx functionality.

 * @param WakeUpPinPolarity Specifies which Wake-Up pin to enable.

 *     This parameter can be one of the following legacy values which set

 *     the default polarity i.e. detection on high level (rising edge):

 *      @arg @ref PWR_WAKEUP_PIN1, PWR_WAKEUP_PIN2, PWR_WAKEUP_PIN4,

 *        PWR_WAKEUP_PIN5,PWR_WAKEUP_PIN6

 *     or one of the following value where the user can explicitly specify

 *     the enabled pin and the chosen polarity:

 *      @arg @ref PWR_WAKEUP_PIN1_HIGH or PWR_WAKEUP_PIN1_LOW

 *      @arg @ref PWR_WAKEUP_PIN2_HIGH or PWR_WAKEUP_PIN2_LOW

 *      @arg @ref PWR_WAKEUP_PIN4_HIGH or PWR_WAKEUP_PIN4_LOW

 *      @arg @ref PWR_WAKEUP_PIN5_HIGH or PWR_WAKEUP_PIN5_LOW

 *      @arg @ref PWR_WAKEUP_PIN6_HIGH or PWR_WAKEUP_PIN6_LOW

 * @note PWR_WAKEUP_PINx and PWR_WAKEUP_PINx_HIGH are equivalent.

 * @retval None

 */

This topic has been closed for replies.
Best answer by TDK

You can't select both edges for wakeup. The hardware doesn't allow for it. Look at the PWR registers in the reference manual.

1 reply

TDK
TDKBest answer
August 27, 2020

You can't select both edges for wakeup. The hardware doesn't allow for it. Look at the PWR registers in the reference manual.

"If you feel a post has answered your question, please click ""Accept as Solution""."