cancel
Showing results for 
Search instead for 
Did you mean: 

STM32 clock switching, systick

MHast.1
Associate II

Hello, I have a simple question: What is the way to update the SysTick configuration after changing the clocks at runtime? I am switching SYSCLK between two modes:

1) RUN mode: HSE 32 MHZ

2) LPRUN mode: MSI 2 MHZ

After changing to (2), the HAL_GetTick() function is running slow and needs reconfiguring. Using STM32WB

1 ACCEPTED SOLUTION

Accepted Solutions
TDK
Guru

If you call HAL_RCC_ClockConfig, it is updated automatically.

If you update the clock some other way, you will need to update SystemCoreClock and call HAL_InitTick after the clock has changed.

If you feel a post has answered your question, please click "Accept as Solution".

View solution in original post

1 REPLY 1
TDK
Guru

If you call HAL_RCC_ClockConfig, it is updated automatically.

If you update the clock some other way, you will need to update SystemCoreClock and call HAL_InitTick after the clock has changed.

If you feel a post has answered your question, please click "Accept as Solution".