cancel
Showing results for 
Search instead for 
Did you mean: 

Having Problems activating SysTick after Stop mode

HMucc.1
Associate II

I'm using STM32F070CBT at 8mhz with almost all pins active (used for GPIOs, PWM, SPI,I2C,etc) , i'm using a timer to enter stop mode with low power regulator and waking up using GPIO external event, after waking up i checked that PWMs and GPIOs are still working but SysTick seems to have stopped as all delay functions enter a infinite loop on HAL_GetTick inside the delay function and SysTick_Handler is not being called anymore (i tested that using breakpoints) , i tried to activate SysTick again using :

  • Hal_Init();
  • HAL_ResumeTick();
  • HAL_InitTick(0);
  • SysTick->CTRL=0b011;

also tried to set SysTick priority to 0, also tried to recall "SystemClock_Config();" alongside SysTick activate function but it didn't work too , does anybody know what i need to do in order to re-activate SysTick?

1 ACCEPTED SOLUTION

Accepted Solutions

-Solved -

Nobody writed a single reply, but i still think it's important to say it if anybody has the same issues, after waking up from Stop mode (which was being called in the interrupt of a timer) , i observed that SysTick Handler was still working and dind't need to be initialized again, but was bugging when i called delay instantly after waking up, so i set one flag and called it using "extern int TickStart" inside the SysTick Handler, and made it count until 9 (which kinda made a 9ms delay using SysTick Handler) , and after that i called the functions i needed outside of that timer interrupt and they worked (HAL_Delay and all functions that use it) , i just observed that the clock was a little different than configured so i needed to call "  SystemClock_Config();" just after waking up and that solved all my code problems.

View solution in original post

2 REPLIES 2
HMucc.1
Associate II

Correction : I checked systick handler (before using delay) and it is indeed entering the breakpoint, but when i call a single HAL_GetTick(); which is the function inside delay it enters a infinite loop and stops entering SysTick Handler

-Solved -

Nobody writed a single reply, but i still think it's important to say it if anybody has the same issues, after waking up from Stop mode (which was being called in the interrupt of a timer) , i observed that SysTick Handler was still working and dind't need to be initialized again, but was bugging when i called delay instantly after waking up, so i set one flag and called it using "extern int TickStart" inside the SysTick Handler, and made it count until 9 (which kinda made a 9ms delay using SysTick Handler) , and after that i called the functions i needed outside of that timer interrupt and they worked (HAL_Delay and all functions that use it) , i just observed that the clock was a little different than configured so i needed to call "  SystemClock_Config();" just after waking up and that solved all my code problems.