diff --git a/pyocd/coresight/dap.py b/pyocd/coresight/dap.py index ed38a200b..9dd39999a 100644 --- a/pyocd/coresight/dap.py +++ b/pyocd/coresight/dap.py @@ -667,7 +667,9 @@ def reset(self, *, send_notifications: bool = True) -> None: self.session.notify(Target.Event.PRE_RESET, self) self.probe.reset() - self.post_reset_recovery() + # Check if we are performing a pre-reset; only do post-reset recovery if not. + if not self.session.context_state.is_performing_pre_reset: + self.post_reset_recovery() if send_notifications: self.session.notify(Target.Event.POST_RESET, self)