Page 1 of 1

SD Card Hangs With Shared SPI Pins

Posted: Thu Sep 13, 2018 9:29 am
by petersanch
I want to connect a SD card on VSPI and also connect a LCD on the same pin for MISO, MOSI, SCK. The 2 CS pins are connected on different ESP pins so that I can control which device the SPI is talking to.

The SD card example included with the ESP32 core hangs after LCD commands.

Code: Select all

cardSize = SD.cardSize() / (1024 * 1024);//works
exampleLCD();//works
writeFile(SD, "/hello.txt", "Hello ");//hangs
In writeFile, it hangs on

Code: Select all

File file = fs.open(path, FILE_WRITE);
What can be causing this? Does VSPI need to be reinitialized after the LCD uses it?

Cheers

Re: SD Card Hangs With Shared SPI Pins

Posted: Thu Sep 13, 2018 6:40 pm
by petersanch
Scope shows there is no activity on SCK during the hang.
Is it maybe something in the "fs" library?