Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add raw JTAG support #86

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
add raw support - make stylebot happy
  • Loading branch information
colinoflynn committed Feb 15, 2021
commit ac4d31dc71e0551b0925a97ca1815d1b899c5fb1
13 changes: 6 additions & 7 deletions pylink/jlink.py
Original file line number Diff line number Diff line change
Expand Up @@ -5191,7 +5191,7 @@ def cp15_register_write(self, cr_n, op_1, cr_m, op_2, value):
if res != 0:
raise errors.JLinkException(res)
return res

###############################################################################
#
# JTAG API (Raw JTAG access for boundary scan or other purposes)
Expand All @@ -5211,20 +5211,19 @@ def jtag_rawrw(self, tdo, tms, numbits=None):
Returns:
tdi (List): Output from device shifted into tdi.
"""

if len(tdo) != len(tms):
raise ValueError("TMS & TDO arrays must be same length")

buf_size = len(tdo)

if numbits is None:
numbits = len(tdo)*8
colinoflynn marked this conversation as resolved.
Show resolved Hide resolved

tdobuf = (ctypes.c_ubyte * buf_size)(*bytearray(tdo))
tmsbuf = (ctypes.c_ubyte * buf_size)(*bytearray(tms))
tdibuf = (ctypes.c_ubyte * buf_size)()

self._dll.JLINKARM_JTAG_StoreGetRaw(tdobuf, tdibuf, tmsbuf, numbits)

return list(tdibuf)

return list(tdibuf)