Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support for ESP32-S2 ESP32-S3 Flash 32MB..128MB (ESPTOOL-325) #675

Closed
wants to merge 6 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
16 changes: 12 additions & 4 deletions esptool.py
Expand Up @@ -135,7 +135,7 @@ def get_default_connected_device(serial_list, port, connect_attempts, initial_ba

DETECTED_FLASH_SIZES = {0x12: '256KB', 0x13: '512KB', 0x14: '1MB',
0x15: '2MB', 0x16: '4MB', 0x17: '8MB',
0x18: '16MB', 0x19: '32MB', 0x1a: '64MB'}
0x18: '16MB', 0x19: '32MB', 0x1a: '64MB', 0x21: '128MB'}


def check_supported_function(func, check_func):
Expand Down Expand Up @@ -1458,7 +1458,10 @@ class ESP32ROM(ESPLoader):
'2MB': 0x10,
'4MB': 0x20,
'8MB': 0x30,
'16MB': 0x40
'16MB': 0x40,
'32MB': 0x50,
'64MB': 0x60,
'128MB': 0x70
}

BOOTLOADER_FLASH_OFFSET = 0x1000
Expand Down Expand Up @@ -3693,7 +3696,7 @@ def write_flash(esp, args):
argfile.seek(0, os.SEEK_END)
if address + argfile.tell() > flash_end:
raise FatalError(("File %s (length %d) at offset %d will not fit in %d bytes of flash. "
"Use --flash-size argument, or change flashing address.")
"Use --flash_size argument, or change flashing address.")
% (argfile.name, argfile.tell(), address, flash_end))
argfile.seek(0)

Expand Down Expand Up @@ -4254,7 +4257,7 @@ def add_spi_flash_subparsers(parent, allow_keep, auto_detect):
parent.add_argument('--flash_mode', '-fm', help='SPI Flash mode',
choices=extra_keep_args + ['qio', 'qout', 'dio', 'dout'],
default=os.environ.get('ESPTOOL_FM', 'keep' if allow_keep else 'qio'))
parent.add_argument('--flash_size', '-fs', help='SPI Flash size in MegaBytes (1MB, 2MB, 4MB, 8MB, 16M)'
parent.add_argument('--flash_size', '-fs', help='SPI Flash size in MegaBytes (1MB, 2MB, 4MB, 8MB, 16MB, 32MB, 64MB, 128MB)'
' plus ESP8266-only (256KB, 512KB, 2MB-c1, 4MB-c1)' + extra_fs_message,
action=FlashSizeAction, auto_detect=auto_detect,
default=os.environ.get('ESPTOOL_FS', 'keep' if allow_keep else '1MB'))
Expand Down Expand Up @@ -4585,6 +4588,11 @@ def __call__(self, parser, namespace, values, option_string=None):
'8m': '1MB',
'16m': '2MB',
'32m': '4MB',
'64m': '8MB',
'128m': '16MB',
'256m': '32MB',
'512m': '64MB',
'1024m': '128MB',
'16m-c1': '2MB-c1',
'32m-c1': '4MB-c1',
}[values[0]]
Expand Down