Hello Michael,
I checked the source code of SysTick_Config() of KSDK1.0.0.
The error case is only that the input parameter is greater than 0x1000000.
Therefore, almost all cases will succeed and it will always cause the SysTick interrupt.
However, the interrupt priority is set to 240.
If a higher priority interrupt than 240 exits, the SysTick interrupt will not be invoked.
But it would not be considered.
From these facts, I think that your GPIO toggling method would be wrong.
Please check it.
Or, is the interrupt really enabled?
I think that it would be no problem because there is 'cpsie i' in the startup routine.
F.Y.I.
#define __NVIC_PRIO_BITS 4
__STATIC_INLINE uint32_t SysTick_Config(uint32_t ticks)
{
if ((ticks - 1) > SysTick_LOAD_RELOAD_Msk) return (1); /* Reload value impossible */
SysTick->LOAD = ticks - 1; /* set reload register */
NVIC_SetPriority (SysTick_IRQn, (1<<__NVIC_PRIO_BITS) - 1); /* set Priority for Systick Interrupt */
SysTick->VAL = 0; /* 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 (0); /* Function successful */
}
__STATIC_INLINE void NVIC_SetPriority(IRQn_Type IRQn, uint32_t priority)
{
if(IRQn < 0) {
SCB->SHP[((uint32_t)(IRQn) & 0xF)-4] = ((priority << (8 - __NVIC_PRIO_BITS)) & 0xff); } /* set Priority for Cortex-M System Interrupts */
else {
NVIC->IP[(uint32_t)(IRQn)] = ((priority << (8 - __NVIC_PRIO_BITS)) & 0xff); } /* set Priority for device specific Interrupts */
}
Best regards,
Yasuhiko Koumoto.