Skip to content

Commit

Permalink
JLINKARM_BeginDownload is void, not int.
Browse files Browse the repository at this point in the history
Reading a return value results in a nonsensical value and frequently an
invalid exception.
  • Loading branch information
cpattenden-sq committed Jul 28, 2023
1 parent f98d7e2 commit 5152e83
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions pylink/jlink.py
Original file line number Diff line number Diff line change
Expand Up @@ -2194,9 +2194,7 @@ def flash(self, data, addr, on_progress=None, power_on=False, flags=0):
pass

# Perform read-modify-write operation.
res = self._dll.JLINKARM_BeginDownload(flags=flags)
if res < 0:
raise errors.JLinkEraseException(res)
self._dll.JLINKARM_BeginDownload(flags=flags)

if isinstance(data, list):
data = bytes(data)
Expand Down

0 comments on commit 5152e83

Please sign in to comment.