2019-09-16 12:42 AM
Hello guys,
I've been trying to enter the Standby Mode using the Exemples from st and i got it work. But in Standby i'm still around 6mA.
This is much more than the expected 5 µA! Maybe someone knows what may cause this Behaviour?
thank you for your help!
/*My Code*/
#define PWR_WAKEUP_PIN_FLAGS (PWR_WAKEUP_FLAG1 | PWR_WAKEUP_FLAG2 | PWR_WAKEUP_FLAG3 | PWR_WAKEUP_FLAG4 | PWR_WAKEUP_FLAG5 | WR_WAKEUP_FLAG6)
void vtest2(void* Param)
{
/* Check and handle if the system was resumed from StandBy mode */
if(__HAL_PWR_GET_FLAG(PWR_FLAG_SB) != RESET)
{
/* Clear Standby flag */
__HAL_PWR_CLEAR_FLAG(PWR_FLAG_SB_D1);
__HAL_PWR_CLEAR_FLAG(PWR_FLAG_SB_D2);
__HAL_PWR_CLEAR_FLAG(PWR_FLAG_SB);
__HAL_PWR_CLEAR_FLAG(PWR_FLAG_WU);
__HAL_PWR_CLEAR_FLAG(PWR_WAKEUP_PIN_FLAGS);
}
/*Disablke WakeUp Pin*/
HAL_PWREx_DisableWakeUpPin(PWR_WAKEUP_PIN4);
/* Clear all related wakeup flags */
HAL_PWREx_ClearWakeupFlag(PWR_WAKEUP_FLAG4);
PWREx_WakeupPinTypeDef sPinParams;
/* Enable WakeUp Pin PWR_WAKEUP_PIN4 connected to PC13*/
sPinParams.WakeUpPin = PWR_WAKEUP_PIN4;
sPinParams.PinPolarity = PWR_PIN_POLARITY_HIGH;
sPinParams.PinPull = PWR_PIN_NO_PULL;
HAL_PWREx_EnableWakeUpPin(&sPinParams);
/*Enter Standby*/
HAL_PWREx_EnterSTANDBYMode(PWR_D1_DOMAIN);
HAL_PWREx_EnterSTANDBYMode(PWR_D2_DOMAIN);
HAL_PWREx_EnterSTANDBYMode(PWR_D3_DOMAIN);
HAL_PWREx_ConfigD3Domain(PWR_D3_DOMAIN_STOP);
HAL_RCC_DeInit();
HAL_PWR_EnterSTANDBYMode();
while_(1)
{
}
}