Skip to content

Commit

Permalink
check flash size for partition file
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelDvP committed Sep 22, 2022
1 parent 2890669 commit f8878ad
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions esp_flasher/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,8 +189,8 @@ def format_bootloader_path(path, model, flash_mode, flash_freq):
return path.replace("$MODEL$", model).replace("$FLASH_MODE$", flash_mode).replace("$FLASH_FREQ$", flash_freq)


def format_partitions_path(path, model):
return path.replace("$MODEL$", model)
def format_partitions_path(path, model, size):
return path.replace("$MODEL$", model).replace("$FLASH$", size)


def configure_write_flash_args(
Expand Down Expand Up @@ -226,7 +226,7 @@ def configure_write_flash_args(
)

if not partitions_path:
partitions_path = format_partitions_path(ESP32_DEFAULT_PARTITIONS, model)
partitions_path = format_partitions_path(ESP32_DEFAULT_PARTITIONS, model, flash_size)

partitions = open_downloadable_binary(partitions_path)
otadata = open_downloadable_binary(otadata_path)
Expand Down
2 changes: 1 addition & 1 deletion esp_flasher/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

ESP32_DEFAULT_OTA_DATA = "boot_app0.bin"
ESP32_DEFAULT_BOOTLOADER_FORMAT = "bootloader_$FLASH_MODE$_$FLASH_FREQ$.bin"
ESP32_DEFAULT_PARTITIONS = "partitions.$MODEL$.bin"
ESP32_DEFAULT_PARTITIONS = "partitions.$MODEL$.$FLASH$.bin"

# https://stackoverflow.com/a/3809435/8924614
HTTP_REGEX = re.compile(
Expand Down
Binary file added partitions.esp32.16MB.bin
Binary file not shown.
File renamed without changes.
File renamed without changes.

0 comments on commit f8878ad

Please sign in to comment.