STM32L433 Wakeup from Stop only on Wakeup Pin 2
In my application i desire to use the STOP2 Mode in a certain condition to save power. Currently i want to implement a wakeup through a "HIGH" on Wakeup Pin 2 of the MCU. Later i want to implement also a periodic wakeup per RTC. But for now, i want only wakeup by the Pin.
I implemented as follwowing:
void pwr_Stop(void){
/* Suspend the Ticker */
HAL_SuspendTick();
/* Disable used wakeup source: PWR_WAKEUP_PIN1 */
HAL_PWR_DisableWakeUpPin(PWR_WAKEUP_PIN1);
HAL_PWR_DisableWakeUpPin(PWR_WAKEUP_PIN2);
HAL_PWR_DisableWakeUpPin(PWR_WAKEUP_PIN4);
HAL_PWR_DisableBkUpAccess();
__HAL_RCC_WAKEUPSTOP_CLK_CONFIG(RCC_STOP_WAKEUPCLOCK_MSI);
/* Clear all related wakeup flags */
__HAL_PWR_CLEAR_FLAG(PWR_FLAG_WU);
/* Enable wakeup pin WKUP1 */
HAL_PWR_EnableWakeUpPin(PWR_WAKEUP_PIN2_HIGH);
/* Go to STOP2 Mode */
HAL_PWREx_EnterSTOP2Mode(PWR_STOPENTRY_WFI);
////////////////
// STOP MODE
////////////////
/* Resume the Ticker */
HAL_ResumeTick();
/* Reinit the clocks */
sysClockConfig();
sysClockEnable();
}But the code does not work as excpeted. There is no wakeup from the pin, i checked the level with oscilloscope and it does change on signal input.
What could be the problem?