On 17/07/2023 00:25, Liviu Ionescu wrote:

On 17 Jul 2023, at 00:18, Tomas Vanek <tom_...@users.sourceforge.net> wrote:

Such breakpoint would collide with the induced rogue break - don't place any 
breakpoint to the PendSV_Handler(), just watch `pendsv_cnt` when execution
stops at BKPT instruction.
...
We need to make sure the PendSV_Handler() is called because there is no rogue 
break issue without an interrupt.
Simply `pendsv_cnt` must be incremented before each stop at BKPT. If not, the 
debugger masks interrupts.
I removed all breakpoints, including the initial one in main() and re-tested.

With J-Link and ST-LINK GDB server, the counter does not go past 1, so it looks 
like the debuggers indeed mask interrupts.

I was curious what is the reason that ST-LINK GDB server shows the induced break only once. Finally I've got it: unlike OpenOCD, the ST-LINK GDB server does not implement skipping over a BKPT instruction at PC address on resume from debug halt. So only BKPT instruction
was executed again and again and the rest of the loop was not run.
If you manually skip over BKPT (e.g. by gdb command 'set $pc+=2') or use a FPB breakpoint instead of BKPT instruction, the silicon errata fires in each loop iteration as well as under OpenOCD.

T

Reply via email to