Screen flickers when reading from SD card

Description

I am using waveshare 7 inch esp32-s3 touch-screen
I have my project running. The screen and SD card both work, but when I try to do anything with the SD card, the display flickers.
I am working with PlatformIO if it’s important.

What MCU/Processor/Board and compiler are you using?

ESP32-S3

What LVGL version are you using?

8.3

What do you want to achieve?

No flicker :grinning:

What have you tried so far?

I tried implementing a file system driver and also just accessing the SD card as usual (in Arduino)
Also, I tried running the SD card code in a task on core 0/1.

Code to reproduce

Screenshot and/or video

short video of the flicker

bumping the thread

I had the same issue and found that SD chip select is not assigned to a regular pin but is driven through an I/O expander.
Because SD.begin() wants a chip select pin number (or it will use pin10 as default), my solution was to provide another pin, choosing one that do not interfere with LCD.

So, using SD.begin(6) did the trick for me. (pin 6 is “sensor AD” which I do not use)

Don’t be tented to use unconnected pins 35, 36 and 37, because they’re used internally for PSRAM.