summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoakim Bech <joakim.bech@linaro.org>2016-09-04 15:38:08 +0200
committerJoakim Bech <joakim.bech@linaro.org>2016-09-04 15:38:08 +0200
commit60c9a60e6daae4de32497f7334d2f47ae32fdbbd (patch)
tree28d1a814408bf6cdd3b7fc269960686040b09d9a
parent8ce25f327dd7aa79446349e446ff4a08c33a6d32 (diff)
Flash with argparse works
Signed-off-by: Joakim Bech <joakim.bech@linaro.org>
-rwxr-xr-xzep2newt.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/zep2newt.py b/zep2newt.py
index 7a87b79..ff5c14c 100755
--- a/zep2newt.py
+++ b/zep2newt.py
@@ -46,7 +46,8 @@ def get_args():
parser.add_argument('--version', action='version', version='%(prog)s 1.0')
- parser.add_argument('-f', required=False, \
+ parser.add_argument('-f', required=False, action="store_true", \
+ default=False, \
help='Flash using JLinkExe')
return parser.parse_args()
@@ -193,7 +194,6 @@ def create_jlink_clear_bit_script(bit_file, bitoffset="0x7bff8"):
def main(argv):
args = get_args()
- try_flash = False
erase = False
if args.verbose:
@@ -223,7 +223,8 @@ def main(argv):
create_jlink_bit_script(curdir + "/boot_image_trailer.bin")
create_jlink_clear_bit_script(curdir + "/empty_boot_image_trailer.bin")
- if try_flash:
+ # Should we try flash?
+ if args.f:
os.system("JLinkExe -CommanderScript flash_zephyr.jlink")