AnsweredAssumed Answered

Installing interrupts with KSDK 2.0?

Question asked by Robert Baruch on Jan 1, 2018

This is sort of resurrecting the thread I started a while back. In that thread, I was having a problem with installing an interrupt routine. The way I solved it was to add -Xlinker --defsym=__ram_vector_table__=1 to the linker options, and then use InstallIRQHandler to explicitly install the IRQ handler.


Now, the other solution was to simply define the IRQ handler and it would override the weak one defined elsewhere.


However, I've dusted off that example, and it does not work! It's very nearly a copy of the PIT example included with the SDK.


volatile bool pitIsrFlag = false;

void PIT0_IRQHandler(void)
/* Clear interrupt flag.*/
PIT_ClearStatusFlags(PIT, kPIT_Chnl_0, kPIT_TimerFlag);
pitIsrFlag = true;


First, when running the code and the timer goes off, I get stuck in IntDefaultHandler. This shows that the IRQ handler was definitely not installed properly. I've checked the map file, and it shows two instances of PIT0_IRQHandler, one from my main file, and one from startup_mk64f12.o.