Xinyuan-LilyGO / LilyGo-LoRa-Series

LILYGO LoRa Series examples

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[SOLVED] How tu use TF CARD on T-Beam S3 Supreme ?

ric-tim opened this issue · comments

I'm looking to use the SD Card in the T-Beam Supreme.
Reading the exchange on #133 doesn't help.
According to the documentation, everything should work with these values:
#define SPI_MOSI (35)
#define SPI_SCK (36)
#define SPI_MISO (37)
#define SPI_CS (47)

SPIClass hSPI(HSPI);
....
void setup(){
Serial.begin(115200);
hSPI.begin(SPI_SCK, SPI_MISO, SPI_MOSI,SPI_CS);
if(!SD.begin(SPI_CS,hSPI)){
Serial.println("Card Mount Failed");
return;
}
....
Still "Card Mount Failed" even though the QMI8658 on the same SPI bus works fine with the https://github.com/lewisxhe/SensorsLib library and IMU_CS (34).

What else do I need to do?
As the bus is shared between SDCard and QMI8658, I tried to manage CS manually, but it didn't help:
#define IMU_CS 34

pinMode(SPI_CS,OUTPUT);
digitalWrite(SPI_CS,LOW);
pinMode(IMU_CS,OUTPUT);
digitalWrite(IMU_CS,HIGH);
Thanks for your help....

Thank you for your reply.
qmi.begin() does give access to the SPI bus and allows you to use QMI8658, but how can you take advantage of this to mount the SD and use the filesystem?
sd.begin(SPI_CS) from the sdfat.h library tries to mount the SD at the same time as the filesystem and fails.

Are you using https://github.com/adafruit/SdFat? Isn’t it the <SD.h> that comes with esp32?

OK. Solved ! Thanks for everything.
The important hint in Lewis He's remarks proposing QMI8658_GetDataExamples is doing initBoards() which could be limited to initPMU(). Indispensable, if I've understood correctly, for using TF Card on T-Beam S3 Core!