From 95611bb854eebd274549fb7b1cae67e02fc32260 Mon Sep 17 00:00:00 2001 From: "radim.karnis" Date: Wed, 27 Oct 2021 10:45:29 +0200 Subject: [PATCH] Add warning for using stub with >16MB flash size --- esptool.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/esptool.py b/esptool.py index 876746a3d..16c387239 100755 --- a/esptool.py +++ b/esptool.py @@ -4588,6 +4588,13 @@ def add_spi_flash_subparsers(parent, allow_keep, auto_detect): detect_flash_size(esp, args) if args.flash_size != 'keep': # TODO: should set this even with 'keep' esp.flash_set_parameters(flash_size_bytes(args.flash_size)) + # Check if stub supports chosen flash size + if esp.IS_STUB and args.flash_size in ('32MB', '64MB', '128MB'): + print("WARNING: Flasher stub doesn't fully support flash size larger than 16MB, in case of failure use --no-stub.") + + if esp.IS_STUB and hasattr(args, "address") and hasattr(args, "size"): + if args.address + args.size > 0x1000000: + print("WARNING: Flasher stub doesn't fully support flash size larger than 16MB, in case of failure use --no-stub.") try: operation_func(esp, args)