AnsweredAssumed Answered

Baremetal SysTick_Handler based on KSDK_CMSIS

Question asked by Michael Bubestinger on Apr 2, 2015

Hi Community,

 

Im starting a project with an KL26Z4 controller. I don't want to use the whole KSDK or PE environment.

I created simple C project including the CMSIS part, startup and linker files provided with the KSDK. I've configured my clock setup in system_MKL26Z4.h and at least the debugger and a LED works .

Next step was to integrate a SysTick_Handler, i thougt it would be an easy task...it is not .

 

There must be some kind of configuration error...but i cant figure it out, maybe you can help.

 

Here is my code (which isnt much..but should be enough for a SysTick Interrupt:

 

main.c:

 

#include "MKL26Z4.h"

#include "board_setup.h"

 

void SysTick_Handler(void){

    /* toogle Led...we are alive */

    GPIOA_PTOR |= (1<<1);

}

 

void main(void){

    board_init(); // Setups PORT_PCR1 and SIMSCGC5

    SysTick_Config(48000000/10000);

    for(;;);

}

 

Attached you can find the files from the KSDK...

Original Attachment has been moved to: startup_MKL26Z4.S.zip

Original Attachment has been moved to: MKL26Z64xxx4_flash.ld.zip

Original Attachment has been moved to: system_MKL26Z4.h.zip

Outcomes