Closed CPlagne closed 3 years ago
You didn't assign SPI to SD Library... it should be like this: if (!SD.begin(HSPI_CS,*hspi)) { Serial.println("Card failed, or not present"); }
Tried the code with the solution but couldn't get it to work for me on a T-Beam v0.7 running a SPI TFT display, LoRa, GPS and a BMP280 barometer. LoRa stopped working!! My search continues for a working solution...
Hi all Is there any update on this ??? @LilyGO Could you please comment, Potentially with a pinout map or some advice?
Hello,
I am attempting to add a microSD card reader to my T-Beam for data collection, and after reading documentation have come to the conclusion that ESP32 makes available two SPI buses, VSPI and HSPI. On the T-Beam V0.7, VSPI uses pins 5, 18,19 and 27, and are all wired directly to LoRa and unavailable. Likewise, HSPI uses pins 12, 13, 14 and 15, with 12 and 15 in particular (meant to be MISO and CS) are used for the GPS as TX and RX respectively. In all, that seems to mean that no SPI bus is fully available.
I have seen users work around this by using other GPIO pins, mostly with the aim of adding a screen (see issue #9 in the old LilyGo repo), and one user over the internet in particular for an SD card, claiming his code worked - this has not been the case for me, and the SD card doesn't mount. Here is their code below :
This code systematically returns "Card failed, or not present" (and failure to create or read the file, obviously). I have made sure that the microSD card reader has a 5V supply like the datasheet recommands, and that the card is formatted in FAT32 and reads and writes files correctly on my computer. Besides creating a software SPI connection, I'm out of ideas.
Thank you in advance