cancel
Showing results for 
Search instead for 
Did you mean: 

wakeup from shutdown mode

josef2
Associate II

Hi,

why does the stm32l496 waking up from shutdown mode using syswkup2 pin and pullup. When I am using an external pullup resistor, the cpu stays in shutdown mode until I set a low signal on syswkup2 pin.

best regards

Josef

3 REPLIES 3
TDK
Guru

The regular pullup doesn't work in shutdown mode. You need to enable it within PWR_PUCRx.

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

Hi TDK,

I am using stm32l4xx_hal_pwr_ex.c for activating the pullup. But nevertheless the effect is as i described befor.

Look at my code:

   HAL_GPIO_WritePin( VBatt_En_GPIO_Port, VBatt_En_Pin, GPIO_PIN_RESET );

   /* Clear wake up Flag */

   __HAL_PWR_CLEAR_FLAG(PWR_FLAG_WUF2);

   HAL_PWREx_EnablePullUpPullDownConfig();

   HAL_PWREx_EnableGPIOPullUp( PWR_GPIO_C, PWR_GPIO_BIT_13 );

   HAL_PWR_EnableWakeUpPin( PWR_WAKEUP_PIN2_LOW );

   HAL_PWR_EnableWakeUpPin( PWR_WAKEUP_PIN5_LOW );

   HalTick = HAL_GetTick();

   while( (HAL_GetTick() - HalTick) < 500 );

   /* Enter shutdown mode */

   HAL_PWREx_EnterSHUTDOWNMode( );

best regards

Josef

TDK
Guru

Is it possible the pull-up is not active until shutdown mode is active, causing it to kick out of shutdown immediately? Measure voltage levels prior to shutdown. Is a pullup on pin 5 not needed? Measuring them digitally (GPIOx->IDR) might be fine.

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