calling ISRs...?

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

calling ISRs...?

533 Views
dougpaulsen
Contributor IV

This is one of those areas where it would be really helpful to subvert the way things are designed to work:  In Codewarrior 6.3, is it possible to call an Interrupt Service Routine?  I can hear people cringing already, but let me explain.

 

I have a Coldfire V1 project to which I have just added embedded End Of Line test code.  While the EOL tests are running of course regular operations need to be suspended and interrupts disabled.  In some parts of the test, the functionality already coded in an ISR is needed.  I have tried to call the ISR directly, which works fine right up to the ISR's RTE instruction, which results in a trap instruction.  Or in other words, bad news.

 

I can see from the RTE instruction description, to make a simple call to an ISR will require (at best) some manual stack loading prior to the call in order for the return address to be found, but is there a better way to do this?  Or even an approved way to do this?

 

Of course, I could just copy the ISR contents to a regular function and call that, but there's a space waste involved, plus the maintenance problem to keep the two code sections coordinated.  Or perhaps have the functionality in one regular function which is called from both the ISR and from the EOL test?  That's probably my fall back, but that ISR took a lot of tuning, and I'd prefer not to mess with it...

 

Thanks for any suggestions!

 

Doug

Labels (1)
0 Kudos
2 Replies

263 Views
dougpaulsen
Contributor IV

Maybe I have answered my own question.  RTE stands for ReTurn from Exception.  The programmers manual states if this instruction is encountered when not in a Supervisor State, a privilege violation exception occurs - which just happens to be what I'm seeing when I call my ISR.  Amazing, isn't it? 

Perhaps my question should be reformulated to as can you generate an exception (in my case, an IRQ) from within software?  Is this a job for a software interrupt - and does Codewarrior 6.3 support software interrupts...?

0 Kudos

263 Views
trytohelp
NXP Employee
NXP Employee

Hi Doug,

It seems you want to simulate an ISR to debug the ISR function.

The MCU V6.3 includes several components you can use in this case.

I've found a post with similar question.

Please have a look to:

      Visualization Tools - True Time Simulator

Have a great day,
Pascal Irrle

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

0 Kudos