Skip to content

fix: grow app partitions to 1.5MB - C3 image no longer fits stock table - #15

Merged
DrewFerg11 merged 1 commit into
mainfrom
fix/c3-partition-bootloop
Jul 11, 2026
Merged

fix: grow app partitions to 1.5MB - C3 image no longer fits stock table#15
DrewFerg11 merged 1 commit into
mainfrom
fix/c3-partition-bootloop

Conversation

@DrewFerg11

Copy link
Copy Markdown
Owner

The ESP32-C3 firmware.bin (1,316,912 bytes) exceeded the 1,310,720-byte app0 slot of the stock default.csv partition table. The bootloader rejects an image larger than its partition on every boot and software-resets forever (rst:0x3 loop) - with the error only on UART0, invisible on USB-only C3 boards. PlatformIO's "Flash: 91.8%" check missed it because it sums ELF sections and omits the ~113KB of MMU-alignment padding present in the flashed .bin.

This presented as "Improv Wi-Fi crashes the C3": linking improv.handleSerial() added the ~5KB that pushed the image over the line. The Improv code itself was never at fault and stays fully enabled on all boards.

  • partitions_4MB.csv: 1.5MB app slots (was 1.25MB), littlefs shrunk to 896KB and moved 0x290000 -> 0x310000, applied to all three boards
  • release.yml: littlefs merge offset updated to match
  • check_app_size.py: post-build guard failing any build whose actual .bin exceeds the app partition, so this can't silently ship again
  • release notes flash table now reports real .bin size vs app partition

Verified on hardware (Teyleten C3 SuperMini): old table boot-loops, new table boots clean and answers Improv device-info RPC over USB.

Note for release notes: devices flashed before this change need one full web-flasher/factory reflash to pick up the new partition table; a C3 app-only OTA onto the old table is rejected (not bricked).

The ESP32-C3 firmware.bin (1,316,912 bytes) exceeded the 1,310,720-byte
app0 slot of the stock default.csv partition table. The bootloader
rejects an image larger than its partition on every boot and
software-resets forever (rst:0x3 loop) - with the error only on UART0,
invisible on USB-only C3 boards. PlatformIO's "Flash: 91.8%" check
missed it because it sums ELF sections and omits the ~113KB of
MMU-alignment padding present in the flashed .bin.

This presented as "Improv Wi-Fi crashes the C3": linking
improv.handleSerial() added the ~5KB that pushed the image over the
line. The Improv code itself was never at fault and stays fully enabled
on all boards.

- partitions_4MB.csv: 1.5MB app slots (was 1.25MB), littlefs shrunk to
  896KB and moved 0x290000 -> 0x310000, applied to all three boards
- release.yml: littlefs merge offset updated to match
- check_app_size.py: post-build guard failing any build whose actual
  .bin exceeds the app partition, so this can't silently ship again
- release notes flash table now reports real .bin size vs app partition

Verified on hardware (Teyleten C3 SuperMini): old table boot-loops,
new table boots clean and answers Improv device-info RPC over USB.

Note for release notes: devices flashed before this change need one
full web-flasher/factory reflash to pick up the new partition table;
a C3 app-only OTA onto the old table is rejected (not bricked).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Expands ESP32 app partitions and adds binary-size validation to prevent oversized firmware boot loops.

Changes:

  • Adds a shared 4 MB partition layout with 1.5 MB OTA slots.
  • Validates actual firmware.bin size after builds.
  • Updates factory-image offsets and release flash-usage metadata.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
platformio.ini Enables the custom partition table and size guard.
partitions_4MB.csv Defines enlarged app slots and relocated LittleFS.
build/scripts/check_app_size.py Rejects oversized firmware binaries.
build/scripts/render_release_notes.py Documents actual binary-size metadata.
.github/workflows/release.yml Updates usage extraction and LittleFS offset.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread build/scripts/render_release_notes.py
@DrewFerg11
DrewFerg11 merged commit 7b6c7f1 into main Jul 11, 2026
10 checks passed
@DrewFerg11
DrewFerg11 deleted the fix/c3-partition-bootloop branch July 11, 2026 16:37
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.

2 participants