Skip to content

Commit dc40aec

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 dc40aec

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
@@ -736,6 +736,9 @@ def main():
736736
parser.add_argument(
737737
"-opt", "--option", type=str, default="", help="call option [sesbanner]"
738738
)
739+
parser.add_argument(
740+
"--port", type=str, help="Serial port device", default="/dev/ttyACM0"
741+
)
739742
parser.add_argument(
740743
"-V", "--version", help="Display Version Number", action="store_true"
741744
)
@@ -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
@@ -106,6 +106,9 @@ def main():
106106
help="run in non-authenticated mode",
107107
default=False,
108108
)
109+
parser.add_argument(
110+
"--port", type=str, help="Serial port device", default="/dev/ttyACM0"
111+
)
109112
parser.add_argument(
110113
"-V", "--version", help="Display Version Number", action="store_true"
111114
)
@@ -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)