Skip to content

Commit b7954ca

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 b7954ca

File tree

3 files changed

+12
-4
lines changed

3 files changed

+12
-4
lines changed

toolkit/app-write-mram.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,9 @@ 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")
142+
parser.add_argument(
143+
"--port", type=str, help="Serial port device", default="/dev/ttyACM0"
144+
)
143145
parser.add_argument("-b", "--baudrate", help="serial port baud rate", type=int)
144146
parser.add_argument(
145147
"-e",
@@ -366,7 +368,7 @@ def main():
366368
isp.discoverSerialPorts()
367369
"""
368370

369-
errorCode = isp.openSerial(args.device)
371+
errorCode = isp.openSerial(args.port)
370372
if errorCode is False:
371373
print("[ERROR] isp openSerial failed for %s" % isp.getPort())
372374
sys.exit(EXIT_WITH_ERROR)

toolkit/maintenance.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -725,6 +725,9 @@ def main():
725725

726726
# Deal with Command Line
727727
parser = argparse.ArgumentParser(description="FUSION Maintenance Tool")
728+
parser.add_argument(
729+
"--port", type=str, help="Serial port device", default="/dev/ttyACM0"
730+
)
728731
parser.add_argument("-b", "--baudrate", help="serial port baud rate", type=int)
729732
parser.add_argument(
730733
"-d",
@@ -776,7 +779,7 @@ def main():
776779
print("Discover")
777780
isp.discoverSerialPorts()
778781

779-
errorCode = isp.openSerial()
782+
errorCode = isp.openSerial(args.port)
780783
if errorCode is False:
781784
print("[ERROR] isp openSerial failed for %s" % isp.getPort())
782785
sys.exit(EXIT_WITH_ERROR)

toolkit/updateSystemPackage.py

+4-1
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)