lvgl / lv_binding_micropython

LVGL binding for MicroPython
MIT License
237 stars 156 forks source link

ili9xxx, rt2046 and CYS (ESP32-24-32s028): spi: alloc_dma_chan(221): no available dma channel #345

Open zelogik opened 2 weeks ago

zelogik commented 2 weeks ago

Problem: I can't get both touch and screen working together.

Version: MicroPython v1.20.0-713-g81d3c1215-dirty on 2024-06-12; ESP32 module with ESP32

Test: The screen and the touchscreen work on simple micropython and/or lv_micropython, if I use that driver: https://github.com/JettIsOnTheNet/Micropython-Examples-for-ESP32-Cheap-Yellow-Display/tree/main Just got some issue with x/y inversion and color issues. Even with C code the CYS works, so it's not an hardware issue.

But i'm unable to get it working with that simple code with lv_micropython:

import espidf as esp
from xpt2046 import xpt2046
disp = ili9341(spihost=esp.HSPI_HOST,factor=8, double_buffer=False, initialize=False, clk=14, dc=2, cs=15, rst=12, miso=16, mosi=13, backlight=-1, power=-1, rot=0xC0, width=320, height=240)
from xpt2046 import xpt2046
touch = xpt2046(spihost=esp.VSPI_HOST, cs=33, clk=25, mosi=32, miso=39)

Error:

E (29870) spi: alloc_dma_chan(221): no available dma channel
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "xpt2046.py", line 58, in __init__
  File "xpt2046.py", line 113, in spi_init
RuntimeError: Failed initializing SPI bus

I don´t really know if it's a bug or it's "normal". Documentation is not helpful with that error too... Any recommendations? Regards