I need to receive an external interrupt using this Micro-controller MPC5746CRM. MPC5746CRM contains an internal module specified to handle the general external interrupt which is SIUL2 module. I made the required initialization as stated in the Datasheet.in the Port module for I/O stack and by initializing some registers manually as described in the section of external interrupt initialization(page 373) then I created an Os ISR in the Autosar Os plugin on which I shall receive this interrupt, I specified the source channel of the interrupt and it's vector.
But once I ran the software I got this ISR very frequently before the init function that initialize the corresponding registers is called, even if I didn't enable this interrupt originally. this frequent coming for that interrupt prevents the ECU to run the software correctly or to be in communication state, all is happened that it reenter such interrupt
In spite of when I checked the Interrupt Status Flag Register0 (SIUL2_ISR0)" of the SIUL2 module with the debugger in the run time, it is saying no interrupt event happened on this pin. also the ISR is still coming
I'm not sure but it looks like wrong interrupt vector is used. I would double check interrupt vector table and I would check other interrupt sources. No other ideas - extensive debugging is necessary here.
a) I configured it as CAT2, but when I tried with CAT1 it gives the same behavior
b) I have no such configuration parameter in Autosar Os plugin.
c) Yes, I'm clearing the interrupt flag once I enter the ISR but the interrupt flag register originally doesn't show that there is an event and here is the issue, how I'm getting this ISR while there is no interrupt event detected
d) Actually I tried it using the oscilloscope, the ISR came before the interrupt pulse has occurred
Final Note: even if I removed the pin configuration from the Port plugin and didn't initialize the corresponding registers, still got the ISR which means in my opinion may be there is an issue with this ISR configuration or something like that.