lvgl_esp32_drivers icon indicating copy to clipboard operation
lvgl_esp32_drivers copied to clipboard

SPI on ESP32-C3 does not work in develop branch

Open flxzt opened this issue 1 year ago • 1 comments

I am trying to get a simple program (based on this ) for the GC9A01 display to work with an ESP32-C3 and vgl v8. I am using the develop branch for it.

this commit seems to have hardcoded the DMA channel to 1, which is not the case in the master branch. I believe the C3 needs SPI_DMA_CH_AUTO.

The device then fails to initialize and outputs:

[0;32mI (341) lvgl_helpers: Max transfer size: 25600 (bytes)
[0;32mI (341) lvgl_helpers: Initializing SPI bus...
[0;31mE (361) spi: spi_bus_initialize(762): invalid dma channel, chip only support spi dma channel auto-alloc

When this is changed to SPI_DMA_CH_AUTO, the initialization seems to be successful, but as soon as the driver sends something over SPI in the mainloop I am then getting

spi_master: check_trans_valid(689): txdata transfer > host maximum

Not sure how to fix this one. I tried setting max_transfer_size here to a low value but it did not have an effect.

flxzt avatar Jul 08 '22 16:07 flxzt

I'm also struggling with this. Seemingly no matter how I change the example it will not work on ESP32-C3. I've tried disabling DMA entirely and modifying things to use regular transfers and that didn't even work although user error is highly probable on that hack job :)

I also noticed that TFT_eSPI, a popular Arduino library supporting ESP32C3, does work however they disable DMA support for ESP32-C3 and claim it does not work. I similarly tried to use it and got a blank screen just like I see in the lv_port_esp32. Pretty suspicious here that it's actually been tested and shown to work on even an officially supported DevKit module with the ESP32-C3 chip.

jasta avatar Mar 09 '23 04:03 jasta