pylink icon indicating copy to clipboard operation
pylink copied to clipboard

Changing a specific memory address

Open GabrielMarconS opened this issue 2 years ago • 2 comments

Hey, I'm new to Python and pylink, but I've managed to flash my target through file. I wanted to know if is it possible to change a specific memory address, if so, any tips?

GabrielMarconS avatar Jun 30 '22 13:06 GabrielMarconS

Hello,

Do you mean changing the last few bytes of the image you're flashing? There are two flashing apis: flash and flash_file. I'm going to assume you're using the latter. If so, then you could use the former and modify the last couple bytes of your image. E.g.

with open('image.bin', 'rb') as f:
    data = f.read()

modified_bytes = [...]
data = data[:len(modified_bytes)] + modified_bytes

Then you could call .flash() with the target address (same as with flash_file), but the modified data above.

hkpeprah avatar Jun 30 '22 16:06 hkpeprah

Ability should be available in v1.0.0 through flash().

hkpeprah avatar Dec 08 '22 19:12 hkpeprah