From e5320924f915c3f3567e19299c7e27f08af85ab0 Mon Sep 17 00:00:00 2001 From: Erik Gilling Date: Thu, 26 Sep 2019 14:39:21 -0700 Subject: [PATCH 1/2] artemis_svl: Print an error if the bin file is not found. --- tools/artemis/artemis_svl.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tools/artemis/artemis_svl.py b/tools/artemis/artemis_svl.py index f0c992be..5378a111 100644 --- a/tools/artemis/artemis_svl.py +++ b/tools/artemis/artemis_svl.py @@ -39,6 +39,7 @@ import sys import time import math +import os.path from sys import exit # *********************************************************************************** @@ -316,6 +317,9 @@ def main(): num_tries = 3 print('\n\nArtemis SVL Bootloader') + if not os.path.exists(args.binfile): + print("Bin file {} does not exits.".format(args.binfile)) + exit() for _ in range(num_tries): From 591a15b8bc297d5b8afea6a31fb6a7dcba07ddf7 Mon Sep 17 00:00:00 2001 From: Erik Gilling Date: Thu, 26 Sep 2019 14:40:03 -0700 Subject: [PATCH 2/2] artemis_svl: Only print serial error message on SerialException The catch all `except:` masks other errors. --- tools/artemis/artemis_svl.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/artemis/artemis_svl.py b/tools/artemis/artemis_svl.py index 5378a111..16690760 100644 --- a/tools/artemis/artemis_svl.py +++ b/tools/artemis/artemis_svl.py @@ -335,7 +335,7 @@ def main(): if( bl_failed == False ): break - except: + except serial.SerialException: phase_serial_port_help() exit()