fix(platformio): match partition table to already-deployed field devices
Pre-OTA sanity check ahead of pushing this firmware to 6-7 units still running the pre-restructure firmware. All four PlatformIO environments were building against min_spiffs.csv, but field devices were originally flashed via Arduino IDE with PartitionScheme=no_fs — the two tables disagree on app1's offset (0x200000 vs 0x1F0000) and both app slot sizes, because min_spiffs.csv carves out an unused 128KB spiffs partition this firmware never touches (SD-card only, zero SPIFFS/ LittleFS references anywhere in the codebase). OTA cannot migrate a device from one partition table to another — the bootloader and running app both resolve offsets from a boot-time snapshot of the table at flash 0x8000, which OTA never reads or writes. A device still on the old no_fs table has no partition entry at 0x1F0000, so a min_spiffs-built OTA image can never land where it needs to be; forcibly rewriting that sector via OTA is an unsupported, unrecoverable-on-power-loss operation Espressif explicitly warns against. Added no_fs.csv (copied verbatim from the Arduino ESP32 core) and switched every environment to it. Verified the built partitions.bin decodes to a byte-for-byte match of what's already burned into field devices. No functionality lost — each app slot actually gained ~64KB by dropping the unused spiffs partition. OTA to existing field devices is now safe without any USB/serial reflash. Catalog entry: docs/features/feature-catalog.md F-059.
This commit is contained in:
+19
-6
@@ -78,9 +78,16 @@ monitor_speed = ${common.monitor_speed}
|
||||
upload_speed = 921600
|
||||
upload_protocol = esptool
|
||||
|
||||
; Partition table — 4MB with OTA support, larger app slots
|
||||
; min_spiffs.csv: ~1.8MB app + ~1.8MB OTA + 64KB NVS + 128KB SPIFFS
|
||||
board_build.partitions = min_spiffs.csv
|
||||
; Partition table — MUST match the layout already burned into field devices
|
||||
; running the pre-restructure firmware (Arduino IDE PartitionScheme=no_fs).
|
||||
; No spiffs partition — this firmware is SD-card only and never used SPIFFS.
|
||||
; Using min_spiffs.csv here would move app1's offset (0x1F0000 vs 0x200000)
|
||||
; and shrink both app slots, which OTA cannot safely migrate on its own —
|
||||
; the currently-burned partition table on those devices has no entry at the
|
||||
; new offset, so pushing a min_spiffs-built binary via OTA leaves the
|
||||
; bootloader unable to find a valid image after the slot flip. See
|
||||
; docs/features/feature-catalog.md F-059 for the full writeup.
|
||||
board_build.partitions = no_fs.csv
|
||||
|
||||
; Upgrade to C++14 so std::make_unique is available
|
||||
build_unflags = -std=gnu++11
|
||||
@@ -118,7 +125,9 @@ monitor_speed = ${common.monitor_speed}
|
||||
upload_speed = 921600
|
||||
upload_protocol = esptool
|
||||
|
||||
board_build.partitions = min_spiffs.csv
|
||||
; Partition table — kept consistent with vesper-std-v1 (see that env's comment
|
||||
; for the full rationale). No spiffs partition; SD-card only, no SPIFFS usage.
|
||||
board_build.partitions = no_fs.csv
|
||||
build_unflags = -std=gnu++11
|
||||
board_build.cmake_extra_args = -DCONFIG_FREERTOS_TIMER_TASK_STACK_DEPTH=4096
|
||||
|
||||
@@ -145,7 +154,9 @@ monitor_speed = ${common.monitor_speed}
|
||||
upload_speed = 921600
|
||||
upload_protocol = esptool
|
||||
|
||||
board_build.partitions = min_spiffs.csv
|
||||
; Partition table — kept consistent with vesper-std-v1 (see that env's comment
|
||||
; for the full rationale). No spiffs partition; SD-card only, no SPIFFS usage.
|
||||
board_build.partitions = no_fs.csv
|
||||
build_unflags = -std=gnu++11
|
||||
board_build.cmake_extra_args = -DCONFIG_FREERTOS_TIMER_TASK_STACK_DEPTH=4096
|
||||
|
||||
@@ -178,7 +189,9 @@ monitor_speed = ${common.monitor_speed}
|
||||
upload_speed = 921600
|
||||
upload_protocol = esptool
|
||||
|
||||
board_build.partitions = min_spiffs.csv
|
||||
; Partition table — kept consistent with vesper-std-v1 (see that env's comment
|
||||
; for the full rationale). No spiffs partition; SD-card only, no SPIFFS usage.
|
||||
board_build.partitions = no_fs.csv
|
||||
build_unflags = -std=gnu++11
|
||||
board_build.cmake_extra_args = -DCONFIG_FREERTOS_TIMER_TASK_STACK_DEPTH=4096
|
||||
|
||||
|
||||
Reference in New Issue
Block a user