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 <noreply@anthropic.com>
This commit is contained in:
Ronny Eia
2026-07-12 15:34:49 +02:00
parent 967fecbf69
commit b5dbc0bcef
2 changed files with 13 additions and 8 deletions

View File

@@ -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,
1 # ESP-IDF partition table: A/B OTA app slots + LittleFS storage.
2 #
3 # Sized for a 4MB flash module (TODO: adjust once real flash size and # Sized for the real 8MB flash module -- confirmed against actual
4 # firmware image size are known). # hardware via `esptool flash_id` (2026-07-12), not assumed from docs;
5 # the previous 4MB layout left half the chip's flash unallocated. Extra
6 # space went mostly to the OTA slots (headroom for future sensor
7 # drivers and Blockly-generated Lua growing the app image), with
8 # `storage` absorbing the remainder rather than leaving flash unused.
9 #
10 # Name, Type, SubType, Offset, Size, Flags
11 nvs, data, nvs, 0x9000, 0x6000,
12 otadata, data, ota, 0xf000, 0x2000,
13 phy_init, data, phy, 0x11000, 0x1000,
14 ota_0, app, ota_0, 0x20000, 0x180000, ota_0, app, ota_0, 0x20000, 0x300000,
15 ota_1, app, ota_1, 0x1A0000, 0x180000, ota_1, app, ota_1, 0x320000, 0x300000,
16 storage, data, littlefs, 0x320000, 0xE0000, storage, data, littlefs, 0x620000, 0x1E0000,