Closed SoftubeBask closed 4 weeks ago
Can you post the full traceback?
Sure, here is the traceback:
Exception in thread Thread-1:
Traceback (most recent call last):
File "/usr/lib/python3.9/threading.py", line 954, in _bootstrap_inner
self.run()
File "/usr/lib/python3.9/threading.py", line 892, in run
self._target(*self._args, **self._kwargs)
File "/home/hwteam/git/vertigo_hil_client/control_interface.py", line 73, in flash_image
jlink_target.flash(image, (int(address, 16)), on_progress=self.on_progress_cb)
File "/home/hwteam/.local/lib/python3.9/site-packages/pylink/jlink.py", line 173, in wrapper
return func(self, *args, **kwargs)
File "/home/hwteam/.local/lib/python3.9/site-packages/pylink/jlink.py", line 2202, in flash
bytes_flashed = self._dll.JLINKARM_WriteMem(addr, len(data), data)
ctypes.ArgumentError: argument 3: <class 'TypeError'>: Don't know how to convert parameter 3
The issue seems to be with image
, and not the address
, as the data
is the third argument to WriteMem()
. What is the type of image
that you pass in here?
jlink_target.flash(image, (int(address, 16)), on_progress=self.on_progress_cb)
Oh, okay. It's a bytearray
Can you try converting it to bytes
?
>>> b = bytearray([1, 2, 3])
>>> type(b)
<class 'bytearray'>
>>> b
bytearray(b'\x01\x02\x03')
>>> b = bytes(b)
>>> type(b)
<class 'bytes'>
>>> b
b'\x01\x02\x03'
Tested to convert it to a list and don't get the exception now at least but I am remoting to the computer with the hardware, so i'm not able to confirm that the hardware boots. But whatever it is, it's probably my conversion to list that would be the culprit if there is any issues. Thank you for your speedy help!
Hello,
Upgraded from 0.11 to the latest (1.2.0) and get the error when trying to flash the target. I've tried to change the parameters but get the same error.
` def on_progress_cb(self, action, progress_string, percentage): if progress_string is not None: print(progress_string)
payload = progress_string.decode('utf-8')
Raw address is 0x60000000 and converted to int it is 1610612736. What am I missing?