> On 13 Jul 2023, at 22:09, Tomas Vanek <tom_...@users.sourceforge.net> wrote:
> 
> It should *NOT* resume. The main purpose of a breakpoint is to stop the 
> execution.

Actually "to stop the execution **during a debug session**".

> Connecting OpenOCD to a target implies enabling the debug mode of the device 
> so IMO there is nothing like "standalone" mode.

I don't know about OpenOCD specifics, but, according to Arm:

"Semihosting is a mechanism that enables code running on an ARM target or 
emulator to communicate with and use the Input/Output facilities on a host 
computer. The host must be running the emulator, or a debugger that is attached 
to the ARM target."

For the full definition, please see:

- 
https://github.com/ARM-software/abi-aa/blob/main/semihosting/semihosting.rst#3introduction

In its essence, semihosting **is** "standalone", it works like a monitor (for 
example RDIMON), and, even when implemented by a debugger, it does not need to 
run in a manned debug session, it just needs to intercept the specific BKPT 
instructions, the rest should run unconstrained.

If OpenOCD does not yet implement this mode, it can be improved.

A few years ago when I re-wrote the semihosting code in OpenCOD I needed it 
only for the Eclipse OpenOCD debug plug-ins, i.e. for use during debug 
sessions. 

Now I moved my development environment outside Eclipse, and I would need it to 
run independently of any debug sessions.

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

Possibly. And the STM32H7, being newer, does not have this bug.
 
> 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.

Hmmm... Can you be more specific on this? What halts do you mean? I definitely 
do not set any breakpoints in my tests, and I expect the interrupts to run at 
full speed.


Liviu



Reply via email to