diff options
-rwxr-xr-x | zep2newt.py | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/zep2newt.py b/zep2newt.py index 40010ce..b2b5354 100755 --- a/zep2newt.py +++ b/zep2newt.py @@ -97,6 +97,21 @@ def create_jlink_script(image_file, offset, erase): f.write("loadfile %s %s\n" % (image_file, hex(int(offset, 16)))) f.write("q\n") f.close() + print("To flash the Image for nrf52 using Jlink run:") + print(" JLinkExe -CommanderScript flash_zephyr.jlink") + +def create_jlink_bit_script(bit_file, bitoffset="0x7bff8"): + with open("flash_bit.jlink", "w+") as f: + f.write("device nrf52\n") + f.write("power on\n") + f.write("sleep 10\n") + f.write("si 1\n") + f.write("speed auto\n") + f.write("loadfile %s %s\n" % (bit_file, hex(int(bitoffset, 16)))) + f.write("q\n") + f.close() + print("To flash Boot Image Trailer for nrf52 using Jlink run:") + print(" JLinkExe -CommanderScript flash_bit.jlink") def usage(): @@ -154,6 +169,9 @@ def main(argv): create_jlink_script(image_file, offset, erase) + curdir = os.path.dirname(sys.argv[0]) + create_jlink_bit_script(curdir + "/boot_image_trailer.bin") + if try_flash: os.system("JLinkExe -CommanderScript flash_zephyr.jlink") |