cancel
Showing results for 
Search instead for 
Did you mean: 

Breakpoint on TRAP interrupt gets removed!

papadeltasierra
Associate III

I'm using the ST Visual Developer V4.3.12 and trying to do what sample stm8s code suggests, namely set a breakpoint on TRAP interrupt (which I am 99% sure it tripping because of a bug in my code).  The debugger keeps "moving", i.e. removing the breakpoint.

What do I have to do to stop this happening?  FWIW I am copying the ST peripherals library code so this is the interrupt routine:

/**
 * @brief TRAP Interrupt routine
 * @PAram  None
 * @retval None
 */
INTERRUPT_HANDLER_TRAP(TRAP_IRQHandler)
{
    /* In order to detect unexpected events during development,
       it is recommended to set a breakpoint on the following instruction.
    */
}
2 REPLIES 2
AA1
Senior III

TRAP interrupt handler is only executed when TRAP instruction is executed. And I don't think your code have a TRAP instruction.

Thanks - my misunderstanding.  I had assumed that a trap could occur if, for example, the program tried to access memory that did not exist or blew the stack.