From b5dbc0bcef102ff9f3fe0551d2ad8801c0a54487 Mon Sep 17 00:00:00 2001 From: Ronny Eia <3652665+eiaro@users.noreply.github.com> Date: Sun, 12 Jul 2026 15:34:49 +0200 Subject: [PATCH] Fix partition table for the real 8MB flash, not assumed 4MB esptool flash_id against the actual DevKitC-1 reports 8MB, not the 4MB partitions.csv/sdkconfig.defaults assumed (never verified against real hardware, just a leftover placeholder from the ESP-IDF scaffold). Half the flash was unallocated. Doubled the OTA slots to 3MB each (headroom for future sensor drivers and Blockly-generated Lua growing the app image) and let the storage partition absorb the remainder rather than leave flash unused. Verified on real hardware: builds, flashes, and boots cleanly with no errors; the app partition now reports 57% free instead of 14%. Co-Authored-By: Claude Sonnet 5 --- partitions.csv | 14 +++++++++----- sdkconfig.defaults | 7 ++++--- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/partitions.csv b/partitions.csv index 131f3fd..73026ac 100644 --- a/partitions.csv +++ b/partitions.csv @@ -1,12 +1,16 @@ # ESP-IDF partition table: A/B OTA app slots + LittleFS storage. # -# Sized for a 4MB flash module (TODO: adjust once real flash size and -# firmware image size are known). +# Sized for the real 8MB flash module -- confirmed against actual +# hardware via `esptool flash_id` (2026-07-12), not assumed from docs; +# the previous 4MB layout left half the chip's flash unallocated. Extra +# space went mostly to the OTA slots (headroom for future sensor +# drivers and Blockly-generated Lua growing the app image), with +# `storage` absorbing the remainder rather than leaving flash unused. # # Name, Type, SubType, Offset, Size, Flags nvs, data, nvs, 0x9000, 0x6000, otadata, data, ota, 0xf000, 0x2000, phy_init, data, phy, 0x11000, 0x1000, -ota_0, app, ota_0, 0x20000, 0x180000, -ota_1, app, ota_1, 0x1A0000, 0x180000, -storage, data, littlefs, 0x320000, 0xE0000, +ota_0, app, ota_0, 0x20000, 0x300000, +ota_1, app, ota_1, 0x320000, 0x300000, +storage, data, littlefs, 0x620000, 0x1E0000, diff --git a/sdkconfig.defaults b/sdkconfig.defaults index 08bac24..a4d2bab 100644 --- a/sdkconfig.defaults +++ b/sdkconfig.defaults @@ -5,9 +5,10 @@ CONFIG_PARTITION_TABLE_CUSTOM=y CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions.csv" -# Matches the 4MB layout assumed in partitions.csv (TODO: adjust both -# together once real hardware's actual flash size is confirmed). -CONFIG_ESPTOOLPY_FLASHSIZE_4MB=y +# Matches the real 8MB flash (confirmed via `esptool flash_id` against +# actual hardware, 2026-07-12) and partitions.csv's layout -- keep both +# in sync if either changes. +CONFIG_ESPTOOLPY_FLASHSIZE_8MB=y # IPv6 is required (not just the ESP-IDF default) -- transport/commissioning # requests a link-local IPv6 address once Wi-Fi STA connects. Explicit here