Exception handling in MPC5604s controller

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

Exception handling in MPC5604s controller

1,005 Views
mhogun
Contributor I

Hi all,

I am trying to configure the exception in mpc5604s controller.

I am  using the following prototype for  interrupt .

When some exceptions occurs the the following function will be invoked..

__interrupt__ void  IVOR15trap(void)

{

}

am i right ? 

Kindly guide me how to configure interrupt when some illegal opcode occurs.

Please provide me the example code if it is possible.

Thank you in advance.

Mohanraj K

0 Kudos
4 Replies

798 Views
martin_kovar
NXP Employee
NXP Employee

Hello,

please see the application note below. It shows, how to create ad implement your own IVOR handler.

http://cache.nxp.com/assets/documents/data/en/application-notes/AN5200.pdf?fsrch=1&sr=1&pageNum=1 

For illegal instruction IVOR6 exception is used. For more details, please look at the e200z0 core reference manual (chapter 5.7.7).

http://cache.nxp.com/assets/documents/data/en/reference-manuals/e200z0RM.pdf?fsrch=1&sr=1&pageNum=1 

Regards,

Martin

0 Kudos

798 Views
mhogun
Contributor I

Hi Martin,

Thank you for the information.

One more question,How to generate the various exceptions?

Kindly guide me to generate IVOR6 exception,IVOR3 exception,IVOR2 exception,

Regards

Mohanraj

0 Kudos

798 Views
martin_kovar
NXP Employee
NXP Employee

Hello Mohanraj,

I will start with the simplest one. IVOR6 is caused for example by illegal instruction or executing privileged instruction in user mode. So you can change the content of code flash using debugger and change correct opcode to illegal opcode or you can switch microcontroller to user mode (set MSR[PR]=1) and execute some privileged instruction.

About IVOR2 and IVOR3 exceptions, please see app note 5200.

http://cache.nxp.com/assets/documents/data/en/application-notes/AN5200.pdf?fsrch=1&sr=1&pageNum=1 

http://cache.nxp.com/assets/documents/data/en/application-notes-software/AN5200SW.zip 

Regards,

Martin

0 Kudos

798 Views
mhogun
Contributor I

Hi Martin,

Thank you for the support.

I will check and get back to you if any support needed.

Regards

Mohanraj

0 Kudos