From c0713a263deb72e337d2abb50b5b1990babc5659 Mon Sep 17 00:00:00 2001 From: lumapu Date: Sat, 18 May 2024 23:14:29 +0200 Subject: [PATCH] 0.8.120 * fix factory generation for ESP32-S3 --- manual/factory_firmware.md | 4 ++-- scripts/add_littlefs_binary.py | 7 ++++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/manual/factory_firmware.md b/manual/factory_firmware.md index f5cd3d91..354bbeb9 100644 --- a/manual/factory_firmware.md +++ b/manual/factory_firmware.md @@ -49,10 +49,10 @@ Windows: ### ESP32-S3 (OpenDTU Fusion Board) Python: -`esptool.py -b 921600 write_flash --flash_mode dio --flash_size detect 0x0 firmware.factory.bin` +`esptool.py -b 921600 write_flash --flash_mode dio --flash_size detect 0x10000 firmware.factory.bin` Windows: -`esptool.exe -b 921600 write_flash --flash_mode dio --flash_size detect 0x0 firmware.factory.bin` +`esptool.exe -b 921600 write_flash --flash_mode dio --flash_size detect 0x10000 firmware.factory.bin` For a 4MB flash size the upload should be finished within 22 seconds. diff --git a/scripts/add_littlefs_binary.py b/scripts/add_littlefs_binary.py index 7afc3391..db766f45 100644 --- a/scripts/add_littlefs_binary.py +++ b/scripts/add_littlefs_binary.py @@ -13,17 +13,18 @@ def build_littlefs(): print("LittleFS build successful") def merge_bins(): - flash_size = int(env.get("BOARD_FLASH_SIZE", "4MB").replace("MB", "")) + flash_size = int(env.BoardConfig().get("upload.maximum_size", "4194304")) app0_offset = 0x10000 if env['PIOENV'][:7] == "esp8266": app0_offset = 0 elif env['PIOENV'][:7] == "esp8285": app0_offset = 0 + print(flash_size) littlefs_offset = 0x290000 - if flash_size == 8: + if flash_size == 0x330000: littlefs_offset = 0x670000 - elif flash_size == 16: + elif flash_size == 0x640000: littlefs_offset = 0xc90000 # save current wd