diff --git a/.gitignore b/.gitignore index e43b0f9..64777da 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ +__pycache__/ .DS_Store diff --git a/esp32_image_parser.py b/esp32_image_parser.py index 6503cf7..4ff679e 100755 --- a/esp32_image_parser.py +++ b/esp32_image_parser.py @@ -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 } @@ -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() @@ -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)