2020-11-25 03:41 AM
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 :
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?
Solved! Go to Solution.
2020-11-25 09:18 AM
-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.
2020-11-25 04:24 AM
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
2020-11-25 09:18 AM
-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.