From 5540f901de35d865b75a13bbb13e9f514d5719f4 Mon Sep 17 00:00:00 2001 From: Julien Calixte Date: Sat, 11 Jul 2026 11:43:34 +0200 Subject: [PATCH] docs(sd): mark SD-on-SPI3 verified on hardware Re-ran the spike on the dedicated SPI3 wiring (CLK 14 / MOSI 15) with the same clean mount + atomic round-trip result. Flip the docs from "pending a re-run" to verified. --- docs/hardware.md | 4 ++-- docs/postmortems/2026-07-05-spike3-sd-cmd59.md | 4 ++-- firmware/README.md | 10 ++++------ 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/docs/hardware.md b/docs/hardware.md index 9a41540..9c4d077 100644 --- a/docs/hardware.md +++ b/docs/hardware.md @@ -30,5 +30,5 @@ live in [`spikes.md`](spikes.md) and [`v0.1-mvp-technical.md`](v0.1-mvp-technical.md#hardware-bring-up-order), with failure write-ups in [`postmortems/`](postmortems/README.md). Notable: the keyboard runs bus-powered on the S3's native USB port, and the SD/FAT stack is -verified on a 32 GB card (2026-07-11), now moving to its own SPI3 host per -ADR-012 ([postmortem](postmortems/2026-07-05-spike3-sd-cmd59.md)). +verified on a 32 GB card on its own SPI3 host (2026-07-11, ADR-012) +([postmortem](postmortems/2026-07-05-spike3-sd-cmd59.md)). diff --git a/docs/postmortems/2026-07-05-spike3-sd-cmd59.md b/docs/postmortems/2026-07-05-spike3-sd-cmd59.md index 708a793..744b561 100644 --- a/docs/postmortems/2026-07-05-spike3-sd-cmd59.md +++ b/docs/postmortems/2026-07-05-spike3-sd-cmd59.md @@ -191,8 +191,8 @@ it is explicitly **not recommended** and not applied. - [x] Enable PSRAM (done, `CONFIG_SPIRAM`) and build Spike 7 (git push) — both complete; see [Spike 7 postmortem](2026-07-05-spike7-gix-https-push.md). - [x] Settle the **shared-bus arbitration** decision → **SD on its own SPI3** - (ADR-012, 2026-07-11); spike rewired to SPI3 (SCK 14 / MOSI 15), pending a - bench re-run on the new wiring. + (ADR-012, 2026-07-11); spike rewired to SPI3 (SCK 14 / MOSI 15) and + **re-verified on hardware 2026-07-11** — same mount + round-trip result. - [ ] **Still open:** implement the FatFS atomic-save (unlink-then-rename + `*.tmp` boot-recovery) in the real `persistence` module. diff --git a/firmware/README.md b/firmware/README.md index b59b42f..362abca 100644 --- a/firmware/README.md +++ b/firmware/README.md @@ -71,9 +71,8 @@ binary — [`src/bin/sd_fat.rs`](src/bin/sd_fat.rs), flashed with `just flash-sd brings up the SD card, mounts FAT at `/sd`, and exercises the persistence module's atomic save (write `*.tmp` → fsync → rename → read-back). Per ADR-012 the SD runs on its **own SPI3 host** — **SCK 14 · MOSI 15 · MISO 13 · SD CS 10** -— leaving the EPD alone on SPI2. (The 2026-07-11 bench proof below ran on the -earlier shared-SPI2 wiring; the code is now rewired to SPI3, pending a re-run -after moving the SCK/MOSI jumpers to 14/15.) +— leaving the EPD alone on SPI2. Verified on the dedicated SPI3 bus 2026-07-11 +(same mount + round-trip result as the initial shared-SPI2 bring-up). Bench result (genuine 32 GB SDHC card): mounts at 10 MHz, `29806 MiB total`, atomic round-trip byte-identical. Two findings baked into the code: @@ -91,9 +90,8 @@ atomic round-trip byte-identical. Two findings baked into the code: for its whole lifetime, and persistence runs on its own thread, so a shared bus would need an EPD rewrite plus a cross-thread mutex on the save path. Instead the SD gets its own SPI3 — the EPD stays untouched, no arbitration. Remaining before -persistence lands in `main.rs`: re-run the spike on the SPI3 wiring, then wire -the atomic save (unlink-then-rename + `*.tmp` boot-recovery) into a `persistence` -module. +persistence lands in `main.rs`: wire the atomic save (unlink-then-rename + +`*.tmp` boot-recovery) into a `persistence` module. **Spike 5 — partial refresh + typing: verified 2026-07-04.** `main.rs` wires the keyboard to the panel: [`src/usb_kbd.rs`](src/usb_kbd.rs) feeds decoded