2024-04-28 03:19 AM
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.
*/
}
2024-04-28 07:34 AM
TRAP interrupt handler is only executed when TRAP instruction is executed. And I don't think your code have a TRAP instruction.
2024-04-28 07:59 AM
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.