Skip to main content
Graduate
April 28, 2024
Question

Breakpoint on TRAP interrupt gets removed!

  • April 28, 2024
  • 1 reply
  • 1163 views

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.
 */
}
    This topic has been closed for replies.

    1 reply

    Visitor II
    April 28, 2024

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

    Graduate
    April 28, 2024

    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.