Once more: esp32, ILI9341 + xpt2046 + sdcard on same spi

Hi @Till_Harbaum!

Yes it’s a possible solution.
But instead, why not change/fix the existing SD card driver to work nicely with other drivers? Is it necessary to write a new driver?
After fixing the driver you can try to push it to upstream Micropython. If for some reason they don’t accept it, we can consider pushing these fixes to lv_micropython directly.

That’s weird. The idea of a shared bus is that the SPI slave reads data from the bus only when CS is asserted. It might still work as long as CS is not asserted on the display/touch drivers but I never tried something like that.

In general, did you find out exactly why SD card driver doesn’t work with LVGL drivers?

One thing that I noticed is that Micropython’s SPI driver is not as flexible as it could have been. For example, it does not allow the user to set max_transfer_sz and it does not allow other drivers to initialize the bus (on LVGL drivers you can pass -1 to miso/mosi/clk arguments and it would assume someone else initialized the SPI bus).
If the Micropython SPI driver either allowed initializing max_transfer_sz or allowed other drivers to initialize the bus, it would probably work together with LVGL drivers. (well, I didn’t try that, there could be additional problems)
More details on: Trying to use external SPI device + lvgl - #2 by amirgon