AnsweredAssumed Answered

AN4561 (3-Phase PMSM Motor Control Kit with the MPC5604P) to TRK-MPC5604P port

Question asked by jasmin rouleau on Jul 3, 2015
Latest reply on Aug 16, 2016 by Peter Vlna



I trying to "port" the AN4561 code for the MTRCKTSPS5604P board to the TRK-MPC5604P. Hardware-wise I think I'm okay but for the application I'm quite unsure... The things is that the app note code is for Green Hills Multi-Ide and I'm using Codewarrior 10.5.


I created a bareboard project for the MPC5604P and added the AN4561 sources to my project. After a lot of changes (newer AMMCLIB, different declaration in jdp_0100_CUT2.0.h vs MPC5604P.h) I manage to get the code to compile. I can start the debugger on run it a bit, but when the interrupts are enabled my code goes to serve the INTC interrupt and dies and the NMI trap.


The handler looks like that:


void INTC_INTCInterruptHandler(void)


    INTCInterruptFn *handlerFn = (INTCInterruptFn*)(*(unsigned int*)&INTC.IACKR.R);


    INTC.EOIR.R = 0;



The location reached by the call " (**handlerFn)();" is clearly wrong. I wonder if the interrupt vector table for GHS and Codewarrior (gnu) compiler are compatible. Any ideas ?