Hi,
As you know that the systick module interrupt period is dependent on the driving clock and SysTick Reload Value Register, which functions as a divider
systick period=driving_clock/Reload_Value
Peripheral Configuration tools can adjust the Reload_Value in SysTick Reload Value Register based on the driving clock so that it can get the constant period you has defined.
I suppose that you can call the function directly which set the SysTick Reload Value Register and enable the systick:
__STATIC_INLINE uint32_t SysTick_Config(uint32_t ticks)
{
if ((ticks - 1UL) > SysTick_LOAD_RELOAD_Msk)
{
return (1UL); /* Reload value impossible */
}
SysTick->LOAD = (uint32_t)(ticks - 1UL); /* set reload register */
NVIC_SetPriority (SysTick_IRQn, (1UL << __NVIC_PRIO_BITS) - 1UL); /* set Priority for Systick Interrupt */
SysTick->VAL = 0UL; /* Load the SysTick Counter Value */
SysTick->CTRL = SysTick_CTRL_CLKSOURCE_Msk |
SysTick_CTRL_TICKINT_Msk |
SysTick_CTRL_ENABLE_Msk; /* Enable SysTick IRQ and SysTick Timer */
return (0UL); /* Function successful */
}
This is systick module clock source:
Hope it can help you
BR
XiangJun Rong