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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
__pycache__/
.DS_Store
9 changes: 9 additions & 0 deletions esp32_image_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ def image2elf(filename, output_file, verbose=False):
section_map = {
'DROM' : '.flash.rodata',
'BYTE_ACCESSIBLE, DRAM, DMA': '.dram0.data',
'BYTE_ACCESSIBLE, DRAM': '.dram0.data',
'IROM' : '.flash.text',
#'RTC_IRAM' : '.rtc.text' TODO
}
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('-appimage', default=False, action='store_true', help='Input file is a single application binary image instead of flash dump')
arg_parser.add_argument('-v', default=False, help='Verbose output', action='store_true')

args = arg_parser.parse_args()
Expand All @@ -230,6 +232,13 @@ def main():
if args.action == 'show_partitions' or args.v is True:
verbose = True

if args.appimage:
if args.action != "create_elf":
print("appimage option can only be used with create_elf action")
if args.output is None:
print("Need output file name")
image2elf(args.input, args.output)

# parse that ish
part_table = read_partition_table(fh, verbose)

Expand Down