Skip to content

Commit 44d1868

Browse files
committed
DAP: fix sending SWJ sequence.
- If the requested protocol was DEFAULT, then that value could be passed to the SWJSequenceSender, which would ignore it. Fixed by updating the protocol after connecting the probe. - Also updated SWJSequenceSender to assert on unhandled protocol.
1 parent 10e006f commit 44d1868

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

pyocd/coresight/dap.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,7 @@ def connect(self, protocol=None):
162162
else:
163163
self._connect_probe(protocol)
164164

165+
protocol = self._probe.wire_protocol
165166
self._connect_dp(protocol)
166167
finally:
167168
self._probe.unlock()

pyocd/probe/swj.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ def select_protocol(self, protocol):
4343
self._switch_to_swd()
4444
elif protocol == DebugProbe.Protocol.JTAG:
4545
self._switch_to_jtag()
46+
else:
47+
assert False, "unhandled protocol %s in SWJSequenceSender" % protocol
4648

4749
def _switch_to_swd(self):
4850
"""! @brief Send SWJ sequence to select SWD."""

0 commit comments

Comments
 (0)