Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions esp32_firmware_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ def print_verbose(verbose, value):
if verbose:
print(value)

def read_partition_table(fh, verbose=False):
fh.seek(0x8000)
def read_partition_table(fh, verbose=False, p_offset=0x8000):
fh.seek(p_offset)
partition_table = {}

print_verbose(verbose, "reading partition table...")
Expand Down
7 changes: 6 additions & 1 deletion esp32_image_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import os, argparse
from makeelf.elf import *
from esptool import *
from esptool.bin_image import *
from esp32_firmware_reader import *
from read_nvs import *

Expand Down Expand Up @@ -220,6 +221,7 @@ def main():
arg_parser.add_argument('-output', help='Output file name')
arg_parser.add_argument('-nvs_output_type', help='output type for nvs dump', type=str, choices=["text","json"], default="text")
arg_parser.add_argument('-partition', help='Partition name (e.g. ota_0)')
arg_parser.add_argument('-partition_offset', help='Set partition offset(HEX) (e.g. 0x8000)')
arg_parser.add_argument('-v', default=False, help='Verbose output', action='store_true')

args = arg_parser.parse_args()
Expand All @@ -231,7 +233,10 @@ def main():
verbose = True

# parse that ish
part_table = read_partition_table(fh, verbose)
if "partition_offset" in args:
args.partition_offset = int(args.partition_offset, 16)

part_table = read_partition_table(fh, verbose, p_offset=args.partition_offset)

if args.action in ['dump_partition', 'create_elf', 'dump_nvs']:
if (args.partition is None):
Expand Down