Enlarge ESP32 app partitions (#1197)

This commit is contained in:
Otto Winter 2020-07-25 14:40:47 +02:00 committed by GitHub
parent 0fc8e8d483
commit 5887fe8302
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -180,6 +180,16 @@ def gather_build_flags():
return list(sorted(list(build_flags))) return list(sorted(list(build_flags)))
ESP32_LARGE_PARTITIONS_CSV = """\
nvs, data, nvs, 0x009000, 0x005000,
otadata, data, ota, 0x00e000, 0x002000,
app0, app, ota_0, 0x010000, 0x1C0000,
app1, app, ota_1, 0x1D0000, 0x1C0000,
eeprom, data, 0x99, 0x390000, 0x001000,
spiffs, data, spiffs, 0x391000, 0x00F000
"""
def get_ini_content(): def get_ini_content():
lib_deps = gather_lib_deps() lib_deps = gather_lib_deps()
build_flags = gather_build_flags() build_flags = gather_build_flags()
@ -196,15 +206,9 @@ def get_ini_content():
if CORE.is_esp32: if CORE.is_esp32:
data['board_build.partitions'] = "partitions.csv" data['board_build.partitions'] = "partitions.csv"
partitions_csv = CORE.relative_build_path('partitions.csv') partitions_csv = CORE.relative_build_path('partitions.csv')
if not os.path.isfile(partitions_csv): write_file_if_changed(partitions_csv, ESP32_LARGE_PARTITIONS_CSV)
with open(partitions_csv, "w") as f:
f.write("nvs, data, nvs, 0x009000, 0x005000,\n")
f.write("otadata, data, ota, 0x00e000, 0x002000,\n")
f.write("app0, app, ota_0, 0x010000, 0x190000,\n")
f.write("app1, app, ota_1, 0x200000, 0x190000,\n")
f.write("eeprom, data, 0x99, 0x390000, 0x001000,\n")
f.write("spiffs, data, spiffs, 0x391000, 0x00F000\n")
# pylint: disable=unsubscriptable-object
if CONF_BOARD_FLASH_MODE in CORE.config[CONF_ESPHOME]: if CONF_BOARD_FLASH_MODE in CORE.config[CONF_ESPHOME]:
flash_mode = CORE.config[CONF_ESPHOME][CONF_BOARD_FLASH_MODE] flash_mode = CORE.config[CONF_ESPHOME][CONF_BOARD_FLASH_MODE]
data['board_build.flash_mode'] = flash_mode data['board_build.flash_mode'] = flash_mode