2018-05-14 12:30 PM
After I upgraded my application from mbed 5.4.7 to 5.7.7, my comparator is unreliable after a STOP. Basically, this is how the MCU is put into sleep (from
:(HAL_PWREx_EnableUltraLowPower();
HAL_PWREx_EnableFastWakeUp();...HAL_PWR_EnterSTOPMode(PWR_LOWPOWERREGULATOR_ON, PWR_STOPENTRY_WFI);...while ( ! LL_PWR_IsActiveFlag_VREFINTRDY() ) {};I assume this has to do with V_REFINT being unstable after resuming the sleep condition.
All works good again when I add a call to
HAL_PWREx_DisableUltraLowPower()
after wake up. Although now I'm happy to have the comparator to work stable again after a stop, disabling the ULP bit in the PWR_CR register doesn't make sense to me when I read the datasheets. What am I missing here?MCU is a STM32L151 (part of a Multitech xDot).
#stm32l1 #wake-up-from-stop-mode2018-05-30 11:56 PM
I using STM32L071RBT6, encounter similar issues, when I set ULP bit by '
HAL_PWREx_EnableUltraLowPower()', the systemtick (using TIM2 as time base) become very slow.
when I clear ULP bit by 'HAL_PWREx_DisableUltraLowPower()
', the systemtick back to normal.I am also very confusing.
2018-06-01 01:12 AM
My issue fixed by clear LPSDSR bit in PWR->CR after wakup from STOP mode. you can try
CLEAR_BIT(PWR->CR, (PWR_CR_PDDS | PWR_CR_LPSDSR));
2018-06-19 12:50 AM
alexhuang
, it seems your issue is something else. I'vetestedCLEAR_BIT(PWR->CR, (PWR_CR_PDDS | PWR_CR_LPSDSR))
but it didn't help. What didworkwas to call this function after recovering from stop mode:
/**
* @brief Disables the Ultra Low Power mode
* @retval None
*/
void HAL_PWREx_DisableUltraLowPower(void)
{
/* Disable the Ultra Low Power mode */
*(__IO uint32_t *) CR_ULP_BB = (uint32_t)DISABLE;
}