ISR Self Identification

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

ISR Self Identification

Jump to solution
838 Views
manishsangram
Contributor IV

Hello,

 

We are using S12ZVMC128 MCU on our custom board.

 

There are about 25 or so interrupts which we are not handling which means the code is generated in CPU.c by PE. The code is set in PE configuration and is common for all ISR that it generates.

 

There is some common error handling we are doing for all these unhandled interrupts. Now we don't want to over ride and write unique code for each of these ISR.

 

So we want some way that the ISR code (which is same for all ISRs) can determine which interrupt it is servicing without writing a different code for each ISR. Basically we want to identify the interrupt within the ISR.

Labels (1)
Tags (2)
0 Kudos
1 Solution
653 Views
RadekS
NXP Employee
NXP Employee

Hi Manish,

Here is example of interrupt catcher for your inspiration:

S12Z Interrupt catcher for unexpected interrupts

All unhandled interrupts are forwarded into one routine, but global variable isrNumber contains vector number.

I hope it help you.

Have a great day,
Radek

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

View solution in original post

0 Kudos
3 Replies
654 Views
RadekS
NXP Employee
NXP Employee

Hi Manish,

Here is example of interrupt catcher for your inspiration:

S12Z Interrupt catcher for unexpected interrupts

All unhandled interrupts are forwarded into one routine, but global variable isrNumber contains vector number.

I hope it help you.

Have a great day,
Radek

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
653 Views
vfilip
NXP Employee
NXP Employee

Hi,

you should be able to switch ISR code on Build options tab available from CPU component, details below.

pastedImage_0.png

best regards

Vojtech Filip

0 Kudos
653 Views
manishsangram
Contributor IV

Hi Vojtech,

We are already writing code in the build options tab for the ISR. The question is not that. The question is that since all the ISR have the same code but I want to log the actual interrupt that took place how can we do that ?

0 Kudos