summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoakim Bech <joakim.bech@linaro.org>2016-09-02 16:03:15 +0200
committerJoakim Bech <joakim.bech@linaro.org>2016-09-02 20:29:24 +0200
commitf8915a2ae9b9a2e4628cb158ba7526ead38d9a7c (patch)
treeb7c02b77b00f7211d1d44aa100b350ddbf0add6d
parent806347ef2fcaf633a4af7c4f74769d1cf2ca783a (diff)
Create boot image trailer jlink file
Signed-off-by: Joakim Bech <joakim.bech@linaro.org>
-rwxr-xr-xzep2newt.py18
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")