Skip to content

Commit fcbe1e6

Browse files
committed
tools: Add serial port arg for most tools.
Add `--port` arg to `maintenance.py`, `updateSystemPackage.py` and `app-write-mram.py` Signed-off-by: iabdalkader <[email protected]>
1 parent cd911c4 commit fcbe1e6

File tree

3 files changed

+18
-6
lines changed

3 files changed

+18
-6
lines changed

toolkit/app-write-mram.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -139,8 +139,12 @@ def main():
139139
parser = argparse.ArgumentParser(
140140
description="NVM Burner for Application TOC Package"
141141
)
142-
parser.add_argument("-d", "--device", type=str, help="serial port device")
143-
parser.add_argument("-b", "--baudrate", help="serial port baud rate", type=int)
142+
parser.add_argument(
143+
"--port", type=str, help="Serial port device", default="/dev/ttyACM0"
144+
)
145+
parser.add_argument(
146+
"-b", "--baudrate", help="serial port baud rate", type=int
147+
)
144148
parser.add_argument(
145149
"-e",
146150
"--erase",
@@ -366,7 +370,7 @@ def main():
366370
isp.discoverSerialPorts()
367371
"""
368372

369-
errorCode = isp.openSerial(args.device)
373+
errorCode = isp.openSerial(args.port)
370374
if errorCode is False:
371375
print("[ERROR] isp openSerial failed for %s" % isp.getPort())
372376
sys.exit(EXIT_WITH_ERROR)

toolkit/maintenance.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -725,7 +725,12 @@ def main():
725725

726726
# Deal with Command Line
727727
parser = argparse.ArgumentParser(description="FUSION Maintenance Tool")
728-
parser.add_argument("-b", "--baudrate", help="serial port baud rate", type=int)
728+
parser.add_argument(
729+
"--port", type=str, help="Serial port device", default="/dev/ttyACM0"
730+
)
731+
parser.add_argument(
732+
"-b", "--baudrate", help="serial port baud rate", type=int
733+
)
729734
parser.add_argument(
730735
"-d",
731736
"--discover",
@@ -776,7 +781,7 @@ def main():
776781
print("Discover")
777782
isp.discoverSerialPorts()
778783

779-
errorCode = isp.openSerial()
784+
errorCode = isp.openSerial(args.port)
780785
if errorCode is False:
781786
print("[ERROR] isp openSerial failed for %s" % isp.getPort())
782787
sys.exit(EXIT_WITH_ERROR)

toolkit/updateSystemPackage.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,9 @@ def main():
8383
default=False,
8484
help="COM port discovery for ISP",
8585
)
86+
parser.add_argument(
87+
"--port", type=str, help="Serial port device", default="/dev/ttyACM0"
88+
)
8689
parser.add_argument(
8790
"-b", "--baudrate", help="(isp) serial port baud rate", type=int
8891
)
@@ -147,7 +150,7 @@ def main():
147150
if args.discover: # discover the COM ports if requested
148151
isp.discoverSerialPorts()
149152

150-
errorCode = isp.openSerial()
153+
errorCode = isp.openSerial(args.port)
151154
if errorCode is False:
152155
print("[ERROR] isp openSerial failed for %s" % isp.getPort())
153156
sys.exit(EXIT_WITH_ERROR)

0 commit comments

Comments
 (0)