diff options
author | Joakim Bech <joakim.bech@linaro.org> | 2016-09-02 16:03:15 +0200 |
---|---|---|
committer | Joakim Bech <joakim.bech@linaro.org> | 2016-09-02 20:29:24 +0200 |
commit | f8915a2ae9b9a2e4628cb158ba7526ead38d9a7c (patch) | |
tree | b7c02b77b00f7211d1d44aa100b350ddbf0add6d | |
parent | 806347ef2fcaf633a4af7c4f74769d1cf2ca783a (diff) |
Create boot image trailer jlink file
Signed-off-by: Joakim Bech <joakim.bech@linaro.org>
-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") |