ISR Self Identification

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

ISR Self Identification

跳至解决方案
897 次查看
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.

标签 (1)
标记 (2)
0 项奖励
1 解答
712 次查看
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 项奖励
3 回复数
713 次查看
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 项奖励
712 次查看
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 项奖励
712 次查看
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 项奖励