Can't mount an SD card

Don’t know if anyone can help, but every which way I try, I can’t get an SD card mounted (It works fine on another ESP32s3),
The adafruit/SdFat - Adafruit Fork @ ^1.5.1 library won’t compile under Platformio using unphone9 as the board…
The current adafruit SdFat library compiles fiine, but the SdFat.begin() call fails.

Can anyone point me towards a fix ?
Regards,
Susan

Hi Susan!

I’m compiling fine in Platformio using Adafruit’s 1.5.1… Have you tried the “everything” library example?

E.g.:

~/unPhoneLibrary/examples/everything $ docker run -it               --user 1000:1000 --group-add=dialout --group-add=ubuntu     -v /home/hamish/unPhoneLibrary/examples/everything:/home/ubuntu/project     -v /tmp/.X11-unix:/tmp/.X11-unix          --env DISPLAY --env MAGIC_COM=     hamishcunningham/iot:magic
entrypoint...
$0 = /home/ubuntu/entrypoint.sh
$* = 
PATH = /home/ubuntu/the-internet-of-things/support/tooling/platformio/penv/bin:/opt/qemu/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
MAGIC_COM = 
pulling latest from git repos...
...
working in /home/ubuntu/project
running shell
(penv) ubuntu@b581c1155c7f:~/project$ pio run -e unphone9
Processing unphone9 (board: unphone9; platform: espressif32 @ ^6.0.1; framework: arduino)
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/espressif32/unphone9.html
PLATFORM: Espressif 32 (6.5.0) > unPhone 9
HARDWARE: ESP32S3 240MHz, 8.31MB RAM, 7.94MB Flash
DEBUG: Current (cmsis-dap) External (cmsis-dap, esp-bridge, esp-builtin, esp-prog, iot-bus-jtag, jlink, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny, tumpa)
PACKAGES: 
 - framework-arduinoespressif32 @ 3.20014.231204 (2.0.14) 
 - tool-esptoolpy @ 1.40501.0 (4.5.1) 
 - toolchain-riscv32-esp @ 8.4.0+2021r2-patch5 
 - toolchain-xtensa-esp32s3 @ 8.4.0+2021r2-patch5
Converting sketch.ino
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 63 compatible libraries
Scanning dependencies...
Dependency Graph
|-- unPhoneLibrary @ 9.0.0+sha.c96180f
|-- Adafruit BusIO @ 1.14.1
|-- Adafruit EPD @ 4.5.2
|-- Adafruit GFX Library @ 1.11.5
|-- Adafruit HX8357 Library @ 1.1.15+sha.2bb675b
|-- Adafruit ImageReader Library @ 2.9.0
|-- Adafruit LIS3MDL @ 1.2.1
|-- Adafruit LSM303DLHC @ 1.0.4
|-- Adafruit LSM6DS @ 4.7.0
|-- Adafruit LSM9DS1 Library @ 2.1.1
|-- Adafruit Unified Sensor @ 1.1.9
|-- DNSServer @ 2.0.0
|-- ESPmDNS @ 2.0.0
|-- FS @ 2.0.0
|-- HTTPClient @ 2.0.0
|-- MCCI Arduino LoRaWAN Library @ 0.9.2
|-- unphone fork of MCCI LoRaWAN LMIC library @ 4.1.1+sha.9151ec5
|-- Preferences @ 2.0.0
|-- SPI @ 2.0.0
|-- SdFat - Adafruit Fork @ 1.5.1
|-- Update @ 2.0.0
|-- WebServer @ 2.0.0
|-- AsyncTCP @ 1.1.1
|-- ESP Async WebServer @ 1.2.3
|-- WiFi @ 2.0.0
|-- WiFiClientSecure @ 2.0.0
|-- WiFiManager @ 2.0.0-rc.1+sha.fe9774f
|-- Wire @ 2.0.0
|-- XPT2046_Touchscreen @ 0.0.0+sha.c766eac
|-- EasyLed @ 1.1.0
Building in release mode
Compiling .pio/build/unphone9/src/sketch.ino.cpp.o
Retrieving maximum program size .pio/build/unphone9/firmware.elf
Checking size .pio/build/unphone9/firmware.elf
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
RAM:   [          ]   0.5% (used 46048 bytes from 8716288 bytes)
Flash: [===       ]  28.2% (used 940933 bytes from 3342336 bytes)
========================================================================================== [SUCCESS] Took 14.60 seconds ==========================================================================================

Environment    Status    Duration
-------------  --------  ------------
unphone9       SUCCESS   00:00:14.598
=========================================================================================== 1 succeeded in 00:00:14.598 ===========================================================================================
(penv) ubuntu@b581c1155c7f:~/project$ 


Thanks Hamish.
Please correct me if I’m mistaken, bit the “everything” sketch doesn’t seem to use the SD card.
Your hardware description suggests that SD_CS is connected to TCA9555, but that doesn’t seem to match with the schematic. This is making it difficult for me to guess what the SD_CS pin assignment should be.
Set at 43 obviously makes bit 3 high. I’ve tried using other values to toggle the 3 msbs, but this hasn’t resolved the issue.
This is all a bit of a shame as it’s currently making the device unsuitable for my intended application.
Do you have any plain, simple examples of the SD card being used, perhaps to write a simple file? My code currently runs fine on an alternate S3 board…

There’s not much point in having a support forum for a product if nobody provides that support. I purchased an Unphone because It’s a UK based educational endeavour. but when you can get a quicker technical response from China it makes this look like a bad decision.

The “everything” sketch displays an image read from the SD card.

PS your posts only appeared in my stream now for some reason. Feel free to reach out via my contact page if that happens again.