This line NVIC_SetPriority (SysTick_IRQn, (1UL << __NVIC_PRIO_BITS) - 1UL) in SysTick_Config() is suspicious. Basically it enables Nested Interrupts because all other interrupts have a priority set to 0.
In the kernel init function, call NVIC_SetPriority(SysTick_IRQn,0) right after calling SysTick_Config().
In files _corecmX.h in the ARM CMSIS:
This line
NVIC_SetPriority (SysTick_IRQn, (1UL << __NVIC_PRIO_BITS) - 1UL)
inSysTick_Config()
is suspicious. Basically it enables Nested Interrupts because all other interrupts have a priority set to 0.In the kernel init function, call
NVIC_SetPriority(SysTick_IRQn,0)
right after callingSysTick_Config()
.