This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

KL25Z Not Executing SysTick_Handler

I am new to embedded software development but I have chosen to begin learning through the KL25Z board.  At the moment, I am exploring the use of SysTick interrupts, but after debugging and reducing my code, I see that it never enters the SysTick ISR.  I am confused as to how I should proceed from here.  If there is an external linkage to the SysTick_Handler() that I need to include, I'm not sure how to do it, or how to trace it down.

Here is my code:

#include "MKL25Z4.h"

/* GLOBAL VARIABLES */

/* FUNCTION PROTOTYPES */

/* MAIN PROGRAM */
int main (void) {
	SIM->SCGC5 |= 0x0400; /* enable clock to Port B */
	PORTB->PCR[18] = 0x100; /* make PTB18 pin as GPIO */
	PTB->PDDR |= 0x040000; /* make PTB18 as output pin */
	SysTick->LOAD = 8388000 - 1; /* reload with number of clocks per 200 ms */
	SysTick->CTRL = 5; /* enable it, no interrupt, use system clock */
	while (1) {
	}
}

/* LED INITIALIZATION */
void SysTick_Handler()
{
	PTB->PTOR = 0x040000; /* toggle red LED */
}

If I put the following into the while loop, the code works as expected (i.e. red on-board LED toggled):

if (SysTick->CTRL & 0x10000) /* if COUNT flag is set */
PTB->PTOR = 0x040000; /* toggle red LED */

These are the RTE packs I have included in Keil uVision5:

Board Support > LED (API) > LED driver for NXP FRDM-KL25Z board

CMSIS > CMSIS-CORE for Cortex-M, SC000, SC300, ARMv8-M, ARMv8.1-M

CMSIS > CMSIS-DSP Library for Cortex-M, SC000, and SC300

CMSIS > CMSIS-NN Neural Network Library

Compiler > Event Recording and Component Viewer via Debug Access Port (DAP)

Device > System Startup for NXP MKL25Z4 Devices

Any pointers that you could give me would be greatly appreciated.

Thank you.