cancel
Showing results for 
Search instead for 
Did you mean: 

STM32L4 STOP2

Ricardo Hassan
Associate III
Posted on May 08, 2018 at 01:29

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);
2 REPLIES 2
Nesrine M_O
Lead II
Posted on May 10, 2018 at 10:12

Hi

,
  1. Did you try the STOP2 example under the STM32L4 cube firmware: STM32Cube_FW_L4_V1.0\Projects\NUCLEO-L496ZG\Examples\PWR\PWR_STOP2
  2. To disable the

    Systick interrupt:

    /* Enter STOP 2 mode */HAL_SuspendTick();HAL_PWREx_EnterSTOP2Mode(PWR_STOPENTRY_WFI);HAL_ResumeTick();�?�?�?�?

-Nesrine-

Posted on May 15, 2018 at 00:57

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