From ea3386f34ab3876a6ab47e7f97004cda5d176d8f Mon Sep 17 00:00:00 2001 From: Andrew Yong Date: Thu, 19 Mar 2026 20:20:15 +0800 Subject: [PATCH] fix(tlora-pager): Remove SDCARD_USE_SPI1 so SX1262 and SD card can share SPI bus (#9870) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Problem: - Inserting a µSD card causes RadioLib to hit a critical error and reboot - Device enters a boot loop as the SD card remains inserted Reproduction: - Insert a µSD card and power on - RadioLib reports a critical error on boot - Device reboots, repeating indefinitely Root cause: - On T-Lora Pager, SX1262 and the µSD slot share the same physical SPI bus (same SCK/MOSI/MISO pins, differentiated only by CS) - SDCARD_USE_SPI1 is intended for boards where SD is on a separate SPI bus; it initializes a second ESP32 SPI peripheral (SPI3) for SD - SPI2 is already driving those same pins for LoRa, so both controllers simultaneously drive the same GPIO lines, causing bus contention Fix: - Remove SDCARD_USE_SPI1 so both devices share a single SPI peripheral (SPI2), with CS pins providing device selection as intended - Tested on a custom fork of device-ui; LoRa and SD card map tiles both work correctly with an SD card inserted Signed-off-by: Andrew Yong --- variants/esp32s3/tlora-pager/platformio.ini | 1 - 1 file changed, 1 deletion(-) diff --git a/variants/esp32s3/tlora-pager/platformio.ini b/variants/esp32s3/tlora-pager/platformio.ini index d35562c2f..dc96113b0 100644 --- a/variants/esp32s3/tlora-pager/platformio.ini +++ b/variants/esp32s3/tlora-pager/platformio.ini @@ -26,7 +26,6 @@ build_flags = ${esp32s3_base.build_flags} -D T_LORA_PAGER -D BOARD_HAS_PSRAM -D HAS_SDCARD - -D SDCARD_USE_SPI1 -D ENABLE_ROTARY_PULLUP -D ENABLE_BUTTON_PULLUP -D ROTARY_BUXTRONICS