AnsweredAssumed Answered

STM32L4 STOP2

Question asked by Ricardo Hassan on May 8, 2018
Latest reply on May 15, 2018 by Ricardo Hassan

Greetings,

    I'm writing an application for an STM32L496, and I'm trying to use Stop2 mode to save power.  My problem is that whenever I go into Stop2 mode, the sys tick immediately wakes up the MCU, even though I have disabled it right before.  What is the right way to disable the sys tick?

 

Ricardo

 

HAL_SuspendTick();
HAL_NVIC_DisableIRQ(SysTick_IRQn);
__HAL_RCC_WAKEUPSTOP_CLK_CONFIG(RCC_STOP_WAKEUPCLOCK_MSI);

__HAL_RCC_GPIOD_CLK_DISABLE();
__HAL_RCC_GPIOB_CLK_DISABLE();
__HAL_RCC_GPIOA_CLK_DISABLE();
__HAL_RCC_GPIOC_CLK_DISABLE();
__HAL_RCC_GPIOE_CLK_DISABLE();
__HAL_RCC_GPIOF_CLK_DISABLE();

HAL_PWREx_EnterSTOP2Mode(PWR_STOPENTRY_WFI);

Outcomes