-
Notifications
You must be signed in to change notification settings - Fork 181
RPi Pico port compilation #174
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
(proper solution: put conditionals around ESPIDF stuff)
Hi @eudoxos!
|
instead of comments as in the first iteration
Done.
I don't have any functional display yet... I was hoping to test with a ssd1306 oled with python-only driver, then I have a HX8357 (PiTFT) lying around and would eventually like to use ST7735-based TFT. I don't know much what is involved TBH. |
Merged! Thank you for this contribution. Did you make some progress with the display driver? I think it's important to provide at least one as a working example. |
based on work of @jgpeiro https://forum.lvgl.io/t/build-lvgl-for-raspberry-pi-pico/5543 . * add brief documentation on building the port Related PR: lvgl/lv_binding_micropython#174
Not yet, though now I have the hardware (ST7735 and ST7789). There are (many) drivers for ST7735 (this one looks the most suitable: https://github.com/szampardi/st77xx_mpy) and @jgpeiro made pure-python driver for ST7789 w/ DMA (+ Xpt2046 touch) which is floating around the forum. The place for drivers is https://github.com/lvgl/lv_drivers, as I understand, plus uPy drivers in https://github.com/lvgl/lv_binding_micropython/tree/master/driver? Is everything platform-specific? Are C drivers preferred to uPy drivers for performance, or does |
LVGL C drivers and Micropython drivers (either C or Python) are separate and independent from each other.
So the location for Micropython drivers is https://github.com/lvgl/lv_binding_micropython/tree/master/driver and is unrelated to https://github.com/lvgl/lv_drivers.
Not necessarily.
It's a good question. Regarding So in general - it would be best to create Pure Python platform-agnostic drivers, but in reality to achieve performance we sometimes have to revert to platform specific code and write at least parts of the driver in C.
You didn't overlook, these things are poorly documented if at all. |
There is something being cooked up (with the help of @jgpeiro) for Xpt2046 touchschreen and ST7789 LCD https://github.com/eudoxos/pico-st7789-driver-lvgl . I just saw Adafruit's displayio, and (while I have reservations about Adafruit forking micropython without giving back upstream much (or is upstream just not interested?)), and that looks like the proper (=scalable, not that every arch needs its own rewrite of drivers) approach. Unlike micropython's framebuffer, they use blitting (not sure about DMA) like what LVGL needs. And they have bunch of drivers ready (those are in python). Would integration of displayio be too much for thismicropython fork? Or are you active upstream to discuss that? |
Great!
Anyone can open an issue or PR on upstream Micropython, or discuss in their forums. They are very friendly, you can try that of you want. Regarding Afafruit, that's a commercial company, when they make open source code they make it only for their own devices. So I'm not sure how compatible it's with other platforms. I suspect that displayio is heavily dependent on Circuitpython specific libraries, and does not stand by itself. Do you see a way to integrate displayio without integrating many other Circuitpython libraries? |
Upstream has been slow to accept changes in the past, and in my humble opinion, still is, relative to the popularity/size of the project. @amirgon's relatively straightforward PR for accelerating QSTR searches (which is necessary for the bindings to perform reasonably) has not been re-reviewed since February despite the requested changes being addressed. I have gotten an inkling from various sources online, my own observations, etc. that they may be suffering from a lack of people to move the project forward rapidly. Until recently, it was often a better choice to use the Of course, it could also be that the consistent stability is a result of a slower development pace.
I'm not 100% sure about this. They do seem to have made some useful changes to MicroPython core that wouldn't apply specifically to their hardware, such as introducing a generational heap, which can help reduce fragmentation issues. I recall seeing that that change as well was offered to upstream in the past and didn't really move forward, however, I cannot find the PR now. (I last looked at these changes a year or two ago.) As far as I know, upstream Micropython is also not structured in a way that external libraries can be added by a user easily, which is the main reason for our fork to exist in the first place. I think that in the long-term, the hope is that https://github.com/lvgl/lv_binding_micropython will be a self-contained module that can be added to any MicroPython tree in order to add LVGL to a project. |
They specifically say that "CircuitPython is focused on beginners, education, and getting folks started super fast.". They also recommend using Micropython for "Advanced APIs such as interrupts and threading" for exmaple. Anyway, they have a CircuitPython emulation layer called Blinka that allows running CircuitPython libraries above either Micropython or Python, and displayio is also supported by Blinka. I'm not sure how well it works, but maybe worth exploring.
This? micropython/micropython#3586
They do support user-modules and we can improve the bindings to take advantage of it (on esp32, stm32 and unix ports) RPi already uses it.
Ideally yes, but in reality it might be too limiting. |
Thank you (both @amirgon and @embeddedt) for sharing your experience!
I did not test, but specifically displayio is in C and ST7789 driver just defines the init sequence, similar to ST7735r.
It looks like pyre-python re-implementation of their |
(proper solution: put conditionals around ESPIDF stuff)
Part of lvgl/lv_micropython#42