From 1b9987c4ee377327ea084dd030fa9d28b6ec7e95 Mon Sep 17 00:00:00 2001 From: Julien Calixte Date: Sat, 11 Jul 2026 11:43:34 +0200 Subject: [PATCH] fix(sd): correct stale shared-bus log strings to SPI3 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The boot banner, success line, and round-trip payload still said "shared SPI2" / "shared bus" after the move to SPI3. Cosmetic only — serial output now matches the dedicated-bus wiring. --- firmware/src/bin/sd_fat.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/firmware/src/bin/sd_fat.rs b/firmware/src/bin/sd_fat.rs index 615a488..bb7fa13 100644 --- a/firmware/src/bin/sd_fat.rs +++ b/firmware/src/bin/sd_fat.rs @@ -77,11 +77,11 @@ fn main() -> Result<()> { esp_idf_svc::sys::link_patches(); esp_idf_svc::log::EspLogger::initialize_default(); - log::info!("Typoena — Spike 3 (SD/FAT on shared SPI2), {BUILD_TAG}"); + log::info!("Typoena — Spike 3 (SD/FAT on dedicated SPI3), {BUILD_TAG}"); match run() { Ok(()) => { - log::info!("✅ Spike 3 complete — mount + atomic write/fsync/rename/read-back on shared bus") + log::info!("✅ Spike 3 complete — mount + atomic write/fsync/rename/read-back on dedicated SPI3") } Err(e) => log::error!("❌ Spike 3 failed: {e:?}"), } @@ -93,7 +93,7 @@ fn main() -> Result<()> { } fn run() -> Result<()> { - let card = mount_sd().context("mounting SD over SPI2")?; + let card = mount_sd().context("mounting SD over SPI3")?; // SAFETY: `card` is a live handle returned by a successful mount. let (max_khz, real_khz) = unsafe { ((*card).max_freq_khz, (*card).real_freq_khz) }; @@ -111,7 +111,7 @@ fn run() -> Result<()> { Ok(()) } -/// Init the shared SPI2 bus and mount the card. Returns the card handle (kept +/// Init the dedicated SPI3 bus and mount the card. Returns the card handle (kept /// alive for the program's lifetime; the spike never unmounts). fn mount_sd() -> Result<*mut sys::sdmmc_card_t> { // 1) Initialize SPI3 with the SD's four lines. Dedicated bus (ADR-012) — no @@ -224,7 +224,7 @@ fn file_roundtrip() -> Result<()> { let path = format!("{MOUNT_STR}/spike3.md"); let tmp = format!("{path}.tmp"); // two dots → exercises long-filename support let payload = - format!("typoena spike 3\n{BUILD_TAG}\nshared SPI2: SCK12 MOSI11 MISO13, SD CS10\n"); + format!("typoena spike 3\n{BUILD_TAG}\ndedicated SPI3: SCK14 MOSI15 MISO13, SD CS10\n"); { let mut f = fs::File::create(&tmp).context("create tmp")?;