From d12cf15c865e20a7ea53ff08e68e21a6b2b972ca Mon Sep 17 00:00:00 2001 From: David Lesnjak Date: Tue, 31 Mar 2026 07:29:31 +0200 Subject: [PATCH] run_cmd: semihosting can be explicitly disabled via the 'enable_semihosting' option --- pyocd/subcommands/run_cmd.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pyocd/subcommands/run_cmd.py b/pyocd/subcommands/run_cmd.py index 0c4fea4ad..05bfd42f9 100644 --- a/pyocd/subcommands/run_cmd.py +++ b/pyocd/subcommands/run_cmd.py @@ -206,8 +206,12 @@ def __init__(self, session: Session, core: Optional[int] = None, rtt_config: "RT self.name = "run-server-%d" % self.core - # Semihosting always enabled - self._enable_semihosting = True + # Semihosting enabled by default, + # but can be explicitly disabled via the 'enable_semihosting' option + if session.options.is_set("enable_semihosting"): + self._enable_semihosting = session.options.get("enable_semihosting") + else: + self._enable_semihosting = True # Lock to synchronize SWO with other activity self._lock = threading.RLock()