On 13/07/2023 20:30, Liviu Ionescu wrote:

On 13 Jul 2023, at 19:12, Liviu Ionescu <i...@livius.net> wrote:

... change OpenOCD to resume it when running with semihosting enabled but 
standalone (i.e. not in a debug session).
Question: what do you think should be a correct behaviour for OpenOCD when an 
explicit BKPT 0 (regular breakpoint) is encountered while executing a 
standalone semihosted program?

In my opinion, it should print a message and resume automatically.

Liviu


It should *NOT* resume. The main purpose of a breakpoint is to stop the execution. Connecting OpenOCD to a target implies enabling the debug mode of the device so IMO there is nothing like "standalone" mode. If you want to keep your test running, write a simple Tcl script to resume the target every time it halts.

I would also guess that the problem is a silicon errata in some versions of Cortex-M7, not yet documented. M7 is the first Cortex-M core with the double-issue pipeline so probably the execution of BKPT and interrupt at the same time
could lead to debug halt at the interrupt context.

BTW combining semihosting with interrupts is not a good practice anyway. Except some basic tests the interrupts are unusable due
to giant latencies caused by debug halts.

Tom

Reply via email to