Skip to main content
Associate III
April 28, 2024
Question

Breakpoint on TRAP interrupt gets removed!

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.

    2 replies

    AA1
    Senior III
    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.

    Associate III
    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.