2018-05-07 04:29 PM
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);2018-05-10 01:12 AM
Hi
,To disable the
Systick interrupt:
/* Enter STOP 2 mode */HAL_SuspendTick();HAL_PWREx_EnterSTOP2Mode(PWR_STOPENTRY_WFI);HAL_ResumeTick();�?�?�?�?
-Nesrine-
2018-05-14 05:57 PM
Hi Nesrine,
I did try that example. I think the issue is related to the fact that I am using FreeRTOS with the timebase set to TIM4. This causes CubeMX to generate those functions you mentioned to start and stop TIM4, but the actual SysTick interrupt still fires.
It turns out that in order to meet other system requirements I'm going to use STANDBY mode instead of STOP2, so this is not a concern at the moment.
Thanks,
Ricardo