square / pylink

Python Library for device debugging/programming via J-Link
https://pylink.readthedocs.io/en/latest/
Other
346 stars 127 forks source link

pylink.errors.JLinkFlashException: Could not write target memory when trying to flash a .hex file. #184

Closed ephraim271 closed 2 months ago

ephraim271 commented 1 year ago

jlink.flash_file returns -270 I'm able to flash through Ozone.

hkpeprah commented 1 year ago

Do you have sample code?

hkpeprah commented 2 months ago

Closing this issue as abandoned, but for future readers, if you run into issues with .hex files, you can convert them to binary, then call flash() like so:

import intelhex

ih = intelhex.IntelHex()
ih.fromfile("myfile.hex", format="hex")

binary_data = ih.tobinarray()