Debug unused ISR using BGND instruction MC9S12XDP512

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

Debug unused ISR using BGND instruction MC9S12XDP512

3,176 Views
sbelanger
Contributor I

Hi,

For unused ISR, the Processor Expert will generate code with the following form :

/*
** ===================================================================
** Method : Cpu_PE_Cpu_PE_ivVsi (bean MC9S12XDP512_112)
**
** Description :
** The method services unhandled interrupt vectors.
** This method is internal. It is used by Processor Expert only.
** ===================================================================
*/

ISR(Cpu_PE_ivVsi)
{
    asm(BGND);
}

I've tried many things like putting my own "assert" method call in the ISR with a regular breakpoint. It won't trigger if in an ISR.

I would like to know how can I set the Hiwave debugger to break on those BGND instruction?

Thanks

 

 

Added p/n to subject.

 



Message Edited by NLFSJ on 2008-07-28 08:47 AM
Labels (1)
0 Kudos
Reply
6 Replies

1,003 Views
sbelanger
Contributor I
Well, I did the following to check if it would work :
 
ISR(Cpu_PE_ivVsi)
{
    ASSERT_ALWAYS(0);
}
 
 
I've set a breakpoint in the ASSERT_ALWAYS() method. However the breakpoint won't trigger if the method is called within an ISR. Please note that if ASSERT_ALWAYS is called elsewhere than an ISR, the Hiwave debugger will halt the excecution and allow me to step into the code.
 
0 Kudos
Reply

1,002 Views
JimDon
Senior Contributor III

Not sure what that macro does, not sure what you mean by method.

About all that you can figure out from a unexpected interrupt is which one it was.

If you jump to some address (or perhaps call a "C" function) you will be able to set a break point there.


0 Kudos
Reply

1,003 Views
sbelanger
Contributor I
Hi Don,
 
In fact the "ASSERT_ALWAYS()" macro is a wrapper for a C function that already has a breakpoint set on it. So if we hit an unexpected condition in our software, the assert function is called and the Hiwave debugger halts the execution right there.
 
For the previous case, I'm just wondering why a breakpoint set on a "C" function won't trigger if this function is called withing an ISR.
0 Kudos
Reply

1,003 Views
JimDon
Senior Contributor III
I see. Well as far as know there should not be an issue with a  break point in an ISR on a function that is called.

You might try an asm jump to a function just to see if that does work. No need to pass any parameters, just set the break point at the top of the function.
I might also suggest that perhaps something else is a play here, and it is not an unexpected interrupt after all.
You didn't say much about the problem itself.






0 Kudos
Reply

1,003 Views
sbelanger
Contributor I
Thanks for the reply Don.
 
The problem I'm facing is that during development some interrupts might occur and I would like to trap them with the Hiwave debugger. Having this, I might have a valid stack and be able to pinpoint from which area of the code the interrupt was triggered. This will enable me to find null pointers, floating point exception, page faults, etc...
0 Kudos
Reply

1,003 Views
JimDon
Senior Contributor III
You can't put jmp some where the set a break point  on somewhere?

0 Kudos
Reply