Skip to content

Commit d3d4130

Browse files
committed
Commander: fix no-init mode.
1 parent 66a50f6 commit d3d4130

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

pyocd/commands/commander.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,10 @@ def run(self):
8181
status, self.session.board.unique_id))
8282
except exceptions.TransferFaultError:
8383
pass
84+
else:
85+
# Say what we're connected to, but without status.
86+
print("Connected to %s [no init mode]: %s" % (self.context.target.part_number,
87+
self.session.board.unique_id))
8488

8589
# Run the REPL interface.
8690
console = PyocdRepl(self.context)

pyocd/commands/execution_context.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ def attach_session(self, session):
202202
@retval False An error occurred when opening the session or initing the context state.
203203
"""
204204
assert self._session is None
205-
assert session.is_open
205+
assert session.is_open or self._no_init
206206
self._session = session
207207

208208
# Select the first core's MEM-AP by default.

0 commit comments

Comments
 (0)