mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-02 04:04:31 +02:00
Add --baud option to parttool
Closes https://github.com/espressif/esp-idf/pull/3753
This commit is contained in:
committed by
Roland Dobai
parent
847e00d17b
commit
aa0c5f03be
@@ -67,9 +67,10 @@ PARTITION_BOOT_DEFAULT = _PartitionId()
|
|||||||
|
|
||||||
class ParttoolTarget():
|
class ParttoolTarget():
|
||||||
|
|
||||||
def __init__(self, port=None, partition_table_offset=PARTITION_TABLE_OFFSET, partition_table_file=None,
|
def __init__(self, port=None, baud=None, partition_table_offset=PARTITION_TABLE_OFFSET, partition_table_file=None,
|
||||||
esptool_args=[], esptool_write_args=[], esptool_read_args=[], esptool_erase_args=[]):
|
esptool_args=[], esptool_write_args=[], esptool_read_args=[], esptool_erase_args=[]):
|
||||||
self.port = port
|
self.port = port
|
||||||
|
self.baud = baud
|
||||||
|
|
||||||
gen.offset_part_table = partition_table_offset
|
gen.offset_part_table = partition_table_offset
|
||||||
|
|
||||||
@@ -118,6 +119,9 @@ class ParttoolTarget():
|
|||||||
if self.port:
|
if self.port:
|
||||||
esptool_args += ["--port", self.port]
|
esptool_args += ["--port", self.port]
|
||||||
|
|
||||||
|
if self.baud:
|
||||||
|
esptool_args += ["--baud", str(self.baud)]
|
||||||
|
|
||||||
esptool_args += args
|
esptool_args += args
|
||||||
|
|
||||||
with open(os.devnull, "w") as null_file:
|
with open(os.devnull, "w") as null_file:
|
||||||
@@ -220,6 +224,7 @@ def main():
|
|||||||
# is specified, that is used instead.
|
# is specified, that is used instead.
|
||||||
parser.add_argument("--port", "-p", help="port where the target device of the command is connected to; the partition table is sourced from this device \
|
parser.add_argument("--port", "-p", help="port where the target device of the command is connected to; the partition table is sourced from this device \
|
||||||
when the partition table file is not defined")
|
when the partition table file is not defined")
|
||||||
|
parser.add_argument("--baud", "-b", help="baudrate to use", type=int)
|
||||||
|
|
||||||
parser.add_argument("--partition-table-offset", "-o", help="offset to read the partition table from", type=str)
|
parser.add_argument("--partition-table-offset", "-o", help="offset to read the partition table from", type=str)
|
||||||
parser.add_argument("--partition-table-file", "-f", help="file (CSV/binary) to read the partition table from; \
|
parser.add_argument("--partition-table-file", "-f", help="file (CSV/binary) to read the partition table from; \
|
||||||
@@ -282,6 +287,9 @@ def main():
|
|||||||
if args.port:
|
if args.port:
|
||||||
target_args["port"] = args.port
|
target_args["port"] = args.port
|
||||||
|
|
||||||
|
if args.baud:
|
||||||
|
target_args["baud"] = args.baud
|
||||||
|
|
||||||
if args.partition_table_file:
|
if args.partition_table_file:
|
||||||
target_args["partition_table_file"] = args.partition_table_file
|
target_args["partition_table_file"] = args.partition_table_file
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user