Files
football2801 013e49d859 fix(13e6): partition + SPI corruption + bootstrap stay-awake
Three problems surfaced during the first 13.3" end-to-end run:

1) LittleFS IntegerDivideByZero on 200 → write /img.bin. Cause: the
   ~3.5 MB SPIFFS in default_16MB.csv can't fit three 960 KB setup
   screens + a 960 KB cached image (~3.84 MB). Switching to a custom
   partitions_13e6.csv with 24 MB LittleFS on the 32 MB flash.

2) Yellow wash across the panel on long SPI bursts. Cause: SPI DMA
   from a PSRAM-backed scratch buffer hits a cache-coherency window —
   the CPU's writes hadn't reached PSRAM yet when DMA read it. Push
   each half in 8 KB chunks through an internal-SRAM (DMA-coherent)
   scratch, and drop the bus clock to 4 MHz to match the 7.3"
   production speed.

3) Bootstrap window (no image yet) was deep-sleeping for 15 s between
   polls — each cycle a ~5 s ROM-boot + Wi-Fi reconnect, so the user
   waited ~20 s × N retries between scanning the setup QR and seeing
   their first photo land. Now normal_operation_impl returns early
   during bootstrap and main.cpp's normal_operation loops with a
   2 s delay, keeping Wi-Fi up. Once the first image arrives, the
   normal scheduled deep sleep takes over.

   Also fixes a related bug Matt called out: a transient TLS hiccup
   during bootstrap was hitting the 5xx fallback path and painting a
   full yellow fill over the green setup QR, leaving the user with
   no claim path. Criterion is now "does /img.bin exist?" (panel has
   something worth showing with a border) rather than "is currentImgId
   set?", so a fresh device with no cached image preserves the setup
   screen through transient network errors.

Diagnostic prints in the panel driver + [op] start/code lines in
normal_operation_impl that proved invaluable during bringup; leaving
them in for now. Tests updated for the new bootstrap semantics
(deep sleep no longer arms on bootstrap-cycle 204/404/5xx); 43/43
native tests pass, 7.3" production build stays byte-identical.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-14 11:50:36 -04:00

845 B

1# Custom partition layout for the Waveshare ESP32-S3-ePaper-13.3E6 (32 MB OPI flash).
2#
3# default_16MB.csv ships ~3.5 MB to SPIFFS — too small once we add a
4# panel-native /img.bin (960 KB) on top of the three setup-screen .bin
5# files (also 960 KB each). LittleFS panics in lfs_ctz_traverse / lfs.c
6# with an IntegerDivideByZero when it runs out of blocks mid-write.
7#
8# This layout: 4 MB app0 + 4 MB app1 (keep OTA option open) + 24 MB
9# LittleFS + 64 KB coredump on 32 MB flash. Plenty of headroom.
10#
11# NameTypeSubTypeOffsetSizeFlags
12nvsdatanvs0x90000x5000
13otadatadataota0xe0000x2000
14app0appota_00x100000x400000
15app1appota_10x4100000x400000
16spiffsdataspiffs0x8100000x17E0000
17coredumpdatacoredump0x1FF00000x10000