Shared SPI SD + ILI9488 file open error

Description

Hi, I’ve a project that mount an SD card with SPI shared with ILI9488 TFT

Actually I’m using LVGL 9 with Lovyangfx library.
SD card is mounted at setup and succesfully open 9 PNG files (tiles) and create a Sprite that contains a map.
In first run of the program I can create the Sprite (from files stored in SD) and display It in the screen (actually i don’t use lvgl Canvas, i put the Sprite direct in screen)

But when LVGL task start (I think this is the problem), SD is already mounted but can’t open another file, for example if i need to generate a new sprite from png files stored in SD or open any file stored in SD.

I’ve checked a lot of things without success always returns error opening file.

I’ve checked also a little program to test SD card with the TFT (without LVGL) and I can read and write files without problems.

I don’t know if really is a problem with LVGL task that always blocks the SPI during screen flush… or something else.

I’ve also tryied to stop lvgl timer, task, etc … (Maybe I’m doing bad this)

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

ESP32-S3 N16R8
ILI9488 TFT with SD module sharing SPI Bus
FT6326 TOUCH
LOVYANGFX
LVGL 9.1

What LVGL version are you using?

9.1

What do you want to achieve?

Use standard FS open without LVGL Filesystem

What have you tried so far?

  • SD file operations with TFT without LVGL (it’s works)
  • SD file operations with TFT and LVGL (it’s works one time in first run, after this doesn’t works)
  • Try to “stop” LVGL timer, task, (screen doesn’t refresh but I can’t open any file)
  • Manually set different SPI CS high or low when access to SD.

Someone had this problem or similar? Sharing SD SPI or other SPI device with LVGL?

Thank you

Solved

Finally the problem was LovyanGfx library that blocks SPI bus.