feat(partition_table): Support recovery bootloader subtype

This commit is contained in:
Konstantin Kondrashov
2024-07-03 17:28:12 +03:00
committed by BOT
parent 1689c7e14f
commit 52f14f344d
10 changed files with 50 additions and 8 deletions

View File

@@ -14,7 +14,7 @@ import tempfile
import gen_esp32part as gen
__version__ = '2.1'
__version__ = '2.2'
COMPONENTS_PATH = os.path.expandvars(os.path.join('$IDF_PATH', 'components'))
ESPTOOL_PY = os.path.join(COMPONENTS_PATH, 'esptool_py', 'esptool', 'esptool.py')
@@ -56,13 +56,14 @@ PARTITION_BOOT_DEFAULT = _PartitionId()
class ParttoolTarget():
def __init__(self, port=None, baud=None, partition_table_offset=PARTITION_TABLE_OFFSET, primary_bootloader_offset=None, partition_table_file=None,
esptool_args=[], esptool_write_args=[], esptool_read_args=[], esptool_erase_args=[]):
def __init__(self, port=None, baud=None, partition_table_offset=PARTITION_TABLE_OFFSET, primary_bootloader_offset=None, recovery_bootloader_offset=None,
partition_table_file=None, esptool_args=[], esptool_write_args=[], esptool_read_args=[], esptool_erase_args=[]):
self.port = port
self.baud = baud
gen.offset_part_table = partition_table_offset
gen.primary_bootloader_offset = primary_bootloader_offset
gen.recovery_bootloader_offset = recovery_bootloader_offset
def parse_esptool_args(esptool_args):
results = list()
@@ -241,6 +242,7 @@ def main():
parser.add_argument('--partition-table-offset', '-o', help='offset to read the partition table from', type=str)
parser.add_argument('--primary-bootloader-offset', help='offset for primary bootloader', type=str)
parser.add_argument('--recovery-bootloader-offset', help='offset for recovery bootloader', type=str)
parser.add_argument('--partition-table-file', '-f', help='file (CSV/binary) to read the partition table from; \
overrides device attached to specified port as the partition table source when defined')
@@ -318,6 +320,9 @@ def main():
if args.primary_bootloader_offset:
target_args['primary_bootloader_offset'] = int(args.primary_bootloader_offset, 0)
if args.recovery_bootloader_offset:
target_args['recovery_bootloader_offset'] = int(args.recovery_bootloader_offset, 0)
if args.esptool_args:
target_args['esptool_args'] = args.esptool_args