Hello,
First,apologies for a long post.
My objective is to run LVGL under Micropython on the Cheap Yellow Display,
but so far without success.
My starting point is this post:
from where I follow the link to a prebuild version of the lvgl firmware 8.3.6. for CYD:
https://stefan.box2code.de/2023/11/18/esp32-grafik-mit-lvgl-und-micropython/
This website is in German, but with help of Google Translate, I have downloaded:
lv_micropython-WROOM.zip, and extracted it.
It contains flash.sh. I have edited it to replace python3 with python, and for
port COM4, which is where my CYD is connected. So it now reads (but without
any carriage returns):
python -m esptool --chip esp32 -p COM4 -b 460800 --before=default_reset
--after=hard_reset write_flash --flash_mode dio --flash_freq 40m
--flash_size 4MB 0x1000 bootloader/bootloader.bin 0x10000
micropython.bin 0x8000 partition_table/partition-table.bin
When above is run on command window it installs the three .bin files.
The installation proceeds as expected with no errors.
From the following webpage:
GitHub - JettIsOnTheNet/Micropython-Examples-for-ESP32-Cheap-Yellow-Display: Micropython examples for Cheap Yellow Display ESP32
I have downloaded three files:
ili9341.py for the CYD display controller
xpt2046.py for the CYD touch screen controller
boot.py which is the code that is to be run.
Using the Thonny IDE, I have copied these files on to the ESP32 chip.
I click the Run button, and the code runs as expected. Each touch on the screen
places a small marker, and shows the screen co-ordinates. If you go to above
link and have a look at the boot.py file you will see thatās what itās meant to do.
So everything is working just fine so far.
BUT the above example does not use LVGL.
To try LVGL, I followed the link in the starting point post to:
GitHub - de-dh/CYD2-MPY-LVGL: This repository is about running LVGL under Miropython firmware on the cheap yellow display.
and from there I downloaded the code as .zip file, and extracted it.
The demo_lvgl folder contains some example files.
I decided to try demo_simple.py. So I took a copy of it, renamed it to main.py.
I added the following at end so that I can see if it is running:
count = 0
while(count<20):
print("Count= ",count)
count+=1
time.sleep(1)
I made a new file, display_driver.py, as instructed in the German website.
I deleted all three previous files from the chip, then loaded main.py and display_driver.py
Then I click Run in Thonny.
I get following error message:
File ādisplay_driver.pyā, line 5, in
AttributeError: āmoduleā object has no attribute āLANDSCAPEā
To fix this, I replace rot=ili9341.LANDSCAPE with rot=0
I click Run again, and now get this message in shell
**************************************
* This library is obsoled now!
* Please, use ili9XXX library instead:
* from ili9XXX import ili9341
***************************************
I then tried pressing Reset button on the board, and it seemed to run!!
The line ācount= 1ā etc was printed in shell at 1 sec intervals, and it
finshed cleanly after 19 sec.
BUT: Nothing at all appeared on the display.
I now click Run again, and get error:
RuntimeError: Failed initializing SPI bus
Pressing Reset button causes it to run again as above.
And thatās as far as Iāve got.
I must mention that my CYD board has only one USB port, so it is not CYD2.
The German website seems to be for CYD2, so perhaps that is the problem.
Can you offer any advice, or direct me to alternative websites ?
Thank you, Ken.