SD Card Hangs With Shared SPI Pins

petersanch
Posts: 15
Joined: Mon Sep 10, 2018 8:58 am

SD Card Hangs With Shared SPI Pins

Postby petersanch » Thu Sep 13, 2018 9:29 am

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

petersanch
Posts: 15
Joined: Mon Sep 10, 2018 8:58 am

Re: SD Card Hangs With Shared SPI Pins

Postby petersanch » Thu Sep 13, 2018 6:40 pm

Scope shows there is no activity on SCK during the hang.
Is it maybe something in the "fs" library?

Who is online

Users browsing this forum: No registered users and 33 guests