From f7c2c6587e64209c70c7635c17b6715e9fa07eef Mon Sep 17 00:00:00 2001 From: clonea1 <33642521+clonea1@users.noreply.github.com> Date: Wed, 9 Sep 2026 19:31:03 -0400 Subject: [PATCH] feat(firmware): add the 16MB flash profile the C6 fleet runs on (#1877) The 4MB and display layouts have 1.875MB and 2MB OTA slots, sized for 4MB and 8MB parts. A 16MB C6 (DevKitC-1 N16) has no layout in the tree at all, so building for one meant hand-editing sdkconfig -- and a smaller table written over a deployed 16MB node relocates NVS and destroys its provisioning, which is why this belongs in the repo rather than in a workstation's untracked sdkconfig. Two 4MB OTA slots, plus a 64K coredump partition and an 8000K FAT volume for on-node storage. Rollback is enabled so an OTA'd image that cannot confirm itself is reverted by the bootloader. Layered, not inherited: sdkconfig.defaults.esp32c6 keeps its 4MB layout so the common 4MB devkit is never silently repartitioned. Claude-Session: https://claude.ai/code/session_01PVWMiHQifoYXL7uL3bphrZ Co-authored-by: Joe Co-authored-by: claude-flow --- firmware/esp32-csi-node/partitions_16mb.csv | 25 +++++++++++++++++++ .../esp32-csi-node/sdkconfig.defaults.16mb | 23 +++++++++++++++++ 2 files changed, 48 insertions(+) create mode 100644 firmware/esp32-csi-node/partitions_16mb.csv create mode 100644 firmware/esp32-csi-node/sdkconfig.defaults.16mb diff --git a/firmware/esp32-csi-node/partitions_16mb.csv b/firmware/esp32-csi-node/partitions_16mb.csv new file mode 100644 index 000000000..bb724d445 --- /dev/null +++ b/firmware/esp32-csi-node/partitions_16mb.csv @@ -0,0 +1,25 @@ +# ESP32-C6 CSI Node - 16MB flash partition table +# For boards with 16MB flash (e.g. ESP32-C6 DevKitC-1 N16). +# +# Two 4MB OTA slots. The app is ~1.04MB, so the slots are far larger than +# needed for the binary alone -- the size is chosen so an OTA never has to +# care how much the image has grown, and it leaves room for a coredump +# partition and an 8MB FAT volume for on-node storage. +# +# The 4MB and display layouts do not fit this: their slots are 1.875MB and +# 2MB, sized for 4MB and 8MB parts respectively. +# +# Usage: set in sdkconfig, or use the matching defaults file: +# CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions_16mb.csv" +# idf.py -DSDKCONFIG_DEFAULTS="sdkconfig.defaults;sdkconfig.defaults.esp32c6;sdkconfig.defaults.16mb" build +# +# Verify before flashing an already-deployed node: a smaller table written +# over a 16MB node relocates NVS and destroys its provisioning. +# Name, Type, SubType, Offset, Size, Flags +nvs,data,nvs,0x9000,24K, +otadata,data,ota,0xf000,8K, +phy_init,data,phy,0x11000,4K, +ota_0,app,ota_0,0x20000,4M, +ota_1,app,ota_1,0x420000,4M, +coredump,data,coredump,0x820000,64K, +storage,data,fat,0x830000,8000K, diff --git a/firmware/esp32-csi-node/sdkconfig.defaults.16mb b/firmware/esp32-csi-node/sdkconfig.defaults.16mb new file mode 100644 index 000000000..f36c59282 --- /dev/null +++ b/firmware/esp32-csi-node/sdkconfig.defaults.16mb @@ -0,0 +1,23 @@ +# ESP32-C6 CSI Node - 16MB Flash SDK Configuration +# For boards with 16MB flash (e.g. ESP32-C6 DevKitC-1 N16). +# +# Layered on top of sdkconfig.defaults.esp32c6, which keeps a 4MB layout +# because 4MB C6 devkits are the common case and must not be silently +# repartitioned by inheriting this. +# +# Build: +# idf.py -DSDKCONFIG_DEFAULTS="sdkconfig.defaults;sdkconfig.defaults.esp32c6;sdkconfig.defaults.16mb" build +# +# Confirm before flashing a deployed node: /ota/status must report +# max_size 4194304. Writing a smaller table over a 16MB node relocates NVS +# and destroys its provisioning. + +CONFIG_ESPTOOLPY_FLASHSIZE_16MB=y +CONFIG_ESPTOOLPY_FLASHSIZE="16MB" +CONFIG_PARTITION_TABLE_CUSTOM=y +CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions_16mb.csv" + +# Firmware rollback: an OTA'd image boots PENDING_VERIFY and must confirm +# itself, or the bootloader reverts on the next boot. See ota_rollback_* in +# ota_update.c for when confirmation happens and why. +CONFIG_BOOTLOADER_APP_ROLLBACK_ENABLE=y