Skip to content

Keep the image small enough for cubes on the old partition table - #86

Merged
elliotmatson merged 1 commit into
mainfrom
fit-old-partition-layout
Oct 5, 2026
Merged

elliotmatson merged 1 commit into
mainfrom
fit-old-partition-layout

Conversation

@elliotmatson

Copy link
Copy Markdown
Owner

Problem

A cube still on v0.6.0-b1 downloads v0.6.1 to 99% and then fails, through both the GitHub updater and the dashboard upload card (ESP_ERR_INVALID_… on the card).

It has Arduino's old min_spiffs.csv partition table, whose app slots are 0x1E0000 = 1,966,080 bytes. Partition tables only change over USB, so it kept that layout through every OTA update. b1 (1,908,496 bytes) fits; telemetry and lost mode took v0.6.0/v0.6.1 to 1,983,728 bytes, 17 KB over. 1,966,080 / 1,983,728 = 99.1%.

Reproduced here by flashing that partition table and b1 to a cube:

E Updates: OTA write failed: ESP_ERR_INVALID_SIZE
E Updates: GitHub update failed (1966080 of 1983728 bytes): ESP_ERR_INVALID_SIZE

Fix

  • CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_SILENT: assertions still stop the cube, but no longer compile in each one's file name and expression. About 59 KB smaller, no speed cost. (-Os would save more but slows rendering.)
  • scripts/size_guard.py: fails the build if firmware.bin outgrows the old 0x1E0000 slot again.
  • CLAUDE.md note.

Local build: 1,915,936 bytes, 50 KB under the old slot.

🤖 Generated with Claude Code

A cube still on v0.6.0-b1 downloaded v0.6.1 to 99% and failed with
ESP_ERR_INVALID_SIZE, through the GitHub updater and the upload card
alike. It has Arduino's min_spiffs.csv partition table, whose app slots
are 0x1E0000 bytes; partition tables only change over USB, so it kept
that layout through every OTA update. b1 fit with 57 KB to spare;
telemetry and lost mode took v0.6.0 to 1,983,728 bytes, 17 KB over.
Reproduced on a cube flashed with that table: "GitHub update failed
(1966080 of 1983728 bytes): ESP_ERR_INVALID_SIZE".

Silent assertions drop each assert's file name and expression strings,
about 59 KB, with no cost in speed. scripts/size_guard.py fails the
build if the image outgrows the old slot again.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Oct 5, 2026

Copy link
Copy Markdown

Tests

124/124 passed.

Suite Tests Passed Failed Time
native:test_firmware_image 14 14 0 3.17s
native:test_pong 6 6 0 0.71s
native:test_remote 7 7 0 0.73s
native:test_rubiks 7 7 0 0.54s
native:test_timezones 5 5 0 0.59s
native:test_sand 6 6 0 0.54s
native:test_bounce 6 6 0 0.64s
native:test_maze 4 4 0 0.56s
native:test_cube_geometry 22 22 0 0.69s
native:test_life 7 7 0 0.58s
native:test_noise 5 5 0 0.67s
native:test_breakout 6 6 0 0.59s
native:test_wordclock 5 5 0 0.57s
native:test_color 6 6 0 0.57s
native:test_langton 5 5 0 0.55s
native:test_particles 7 7 0 0.58s
native:test_weather 6 6 0 0.65s

@github-actions

github-actions Bot commented Oct 5, 2026

Copy link
Copy Markdown

Static analysis

No defects found.

pio check, failing on high and above. 1 defect in downloaded dependencies withheld; pass include-dependencies to see them.

@github-actions

github-actions Bot commented Oct 5, 2026

Copy link
Copy Markdown

Firmware size

+28.4 KB across 1 environment.

Env Image Δ App partition Flash Δ RAM Δ
esp32-s3-devkitc-1 ⚠️ 1.84 MB +28.4 KB 23.7% → 24.07% +28.4 KB +34.3 KB
esp32-s3-devkitc-1 — 8 section(s) changed
Section Base Head Δ
.flash_rodata_dummy 1.19 MB 1.25 MB +64.0 KB
.flash.text 1.18 MB 1.23 MB +58.2 KB
.flash.rodata 517.6 KB 496.4 KB -21.3 KB
.dram0.dummy 87.5 KB 82.8 KB -4.8 KB
.iram0.text 102.4 KB 97.7 KB -4.7 KB
.dram0.data 23.8 KB 20.0 KB -3.9 KB
.dram0.bss 37.8 KB 37.9 KB +184 B
.iram0.text_end 61 B 37 B -24 B
esp32-s3-devkitc-1 — 1136 symbol(s) changed
Symbol Base Head Δ
esp_mqtt_task 0 B 4.5 KB +4.5 KB
Telemetry::publishBoot() 0 B 2.8 KB +2.8 KB
Telemetry::publishCrash(bool) 0 B 2.8 KB +2.8 KB
Telemetry::scanInto(ArduinoJson::V743PB22::JsonArray, int) 0 B 2.1 KB +2.1 KB
esp_mqtt_set_config 0 B 2.0 KB +2.0 KB
_ZNK11ArduinoJson8V743PB226detail11VariantData6acceptINS1_14JsonSerializerINS1_6WriterI6StringvEEEEEENT_11result_typeERS9_PKNS1_15ResourceManagerE$isra$0 1.5 KB 3.4 KB +2.0 KB
Telemetry::publishSettings() 0 B 1.9 KB +1.9 KB
__func__$0 2.0 KB 256 B -1.8 KB
ws_read 0 B 1.5 KB +1.5 KB
Telemetry::publishLocation() 0 B 1.5 KB +1.5 KB
__func__$1 1.6 KB 161 B -1.4 KB
packet$5 0 B 1.4 KB +1.4 KB
packet$6 1.4 KB 0 B -1.4 KB
tcp_connect 638 B 2.0 KB +1.4 KB
Telemetry::publishHealth() 0 B 1.4 KB +1.4 KB
+1121 more

Baseline: ec0c25b. Image size is firmware.bin against the smaller app partition slot. RAM is static allocation only — the linker cannot see heap or stack.

@elliotmatson
elliotmatson merged commit df4e898 into main Oct 5, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant