From 172c903f0925956fc93281a7e3a50ba4d80b0eb5 Mon Sep 17 00:00:00 2001 From: Scott Penrose Date: Tue, 16 Jun 2026 13:25:45 +1000 Subject: [PATCH] Valid SD pins for T3S3 --- platformio.ini | 9 +++++---- src/main.cpp | 4 ++-- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/platformio.ini b/platformio.ini index e064fb4..f94dbe9 100644 --- a/platformio.ini +++ b/platformio.ini @@ -87,11 +87,12 @@ build_flags = -DGPIO_RESET_PIN=2 ; CONFIRM: -> sensor RST -DGPIO_WAKE_PIN=1 ; CONFIRM: -> sensor control/wake pin -DGPIO_CTRL_ACTIVE_LOW=1 - ; --- microSD (CONFIRM: may share the LoRa SPI bus + own CS) --- - -DT3S3_SD_SCK=5 - -DT3S3_SD_MISO=3 - -DT3S3_SD_MOSI=6 + ; --- microSD on FSPI/SPI2 (separate bus from LoRa, which uses HSPI/SPI3) --- + -DT3S3_SD_SCK=14 + -DT3S3_SD_MISO=2 + -DT3S3_SD_MOSI=11 -DT3S3_SD_CS=13 + -DT3S3_SD_FREQ_HZ=20000000UL ; --- timezone for NTP-dated logs (Australia/Victoria) --- -DNTP_TZ='"AEST-10AEDT,M10.1.0,M4.1.0/3"' lib_deps = diff --git a/src/main.cpp b/src/main.cpp index aeb58c1..ea8a7e3 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -129,7 +129,7 @@ bool sdAvailable = false; bool logEnabled = true; // ON by default once we have a date bool ntpSynced = false; #if BOARD_T3S3 -SPIClass sdSPI(HSPI); +SPIClass sdSPI(FSPI); File logFile; bool logAtLineStart = true; char logPath[40] = {0}; @@ -565,7 +565,7 @@ void setupWiFi() { #if BOARD_T3S3 void setupSD() { sdSPI.begin(T3S3_SD_SCK, T3S3_SD_MISO, T3S3_SD_MOSI, T3S3_SD_CS); - sdAvailable = SD.begin(T3S3_SD_CS, sdSPI); + sdAvailable = SD.begin(T3S3_SD_CS, sdSPI, T3S3_SD_FREQ_HZ); Serial.printf("[SD] %s (CS=%d)\n", sdAvailable ? "mounted" : "NOT found -- check T3S3_SD_* pins", T3S3_SD_CS); }