2020-04-30 02:18 AM
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
2020-04-30 06:12 AM
The regular pullup doesn't work in shutdown mode. You need to enable it within PWR_PUCRx.
2020-04-30 06:35 AM
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
2020-04-30 08:14 AM
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.