@stefanglatz
What tool are you using for software development?
If you're using MCUXpresso, then setting the interrupt handler is a bit non-intuitive because you have to understand C99's "weak" methods.
By default the interrupt handler vector table is defined with "weak" default handler methods. To define your own application in the vector table, you don't explicitly write to the vector table, you simply create your handler specified as the handler.
To do, this, you create a define specifying that your handler's label is the specific interrupt handler and then put in the handler code. The address of your code is automagically written to the interrupt handler vector table.
For my PIT0 Interrupt handler, I use the define and code:
#define PIT_RUN_TASK_HANDLER PIT0_IRQHandler
:
void PIT_RUN_TASK_HANDLER(void) {
/* Clear interrupt flag.*/
PIT_ClearStatusFlags(PIT, kPIT_Chnl_0, kPIT_TimerFlag);
++RTOS_RunTimeCounter;
/* Added for, and affects, all PIT handlers. For CPU clock which is much larger than the IP bus clock,
* CPU can run out of the interrupt handler before the interrupt flag being cleared, resulting in the
* CPU's entering the handler again and again. Adding DSB can prevent the issue from happening.
*/
__DSB();
}
Again, not very intuitive but once you understand how the "weak" attribute to methods work, it's quite simple.
Hope this helps!
myke