diff options
author | Joakim Bech <joakim.bech@linaro.org> | 2016-09-04 15:38:08 +0200 |
---|---|---|
committer | Joakim Bech <joakim.bech@linaro.org> | 2016-09-04 15:38:08 +0200 |
commit | 60c9a60e6daae4de32497f7334d2f47ae32fdbbd (patch) | |
tree | 28d1a814408bf6cdd3b7fc269960686040b09d9a | |
parent | 8ce25f327dd7aa79446349e446ff4a08c33a6d32 (diff) |
Flash with argparse works
Signed-off-by: Joakim Bech <joakim.bech@linaro.org>
-rwxr-xr-x | zep2newt.py | 7 |
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") |