Hello community.
I’m trying to run the lv_port_esp32 example on my ESP32.
I’m using a 1.8TFT SPI 128x160 display.
I also use develop/lvgl_7.11.0_idf_5.0
for lvgl_esp32_drivers and v7.11.0
for lvgl.
Description
I use the following connections:
- PIN LED to 3.3V
- PIN SCK to GPIO14
- PIN SDA to GPIO13
- PIN A0 to GPIO2
- PIN RESET to GPIO4
- PIN CS to GPIO15
- PIN GND to ground
- PIN VCC to 5V
Running the example I don’t see the correct result on the screen.
What MCU/Processor/Board and compiler are you using?
I use ESP-IDF v4.4.4-336-g4b404115e8
with ESP32-WROOM-32.
lvgl_log_build.txt (20.9 KB)
What do you want to achieve?
I’d like to see the windows shown in the examples.
What have you tried so far?
I see this picture on the screen with fluctuations of the content but it doesn’t work.
In the serial monitor I don’t notice anything “strange”:
I (0) cpu_start: App cpu up.
I (297) cpu_start: Pro cpu start user code
I (297) cpu_start: cpu freq: 160000000
I (297) cpu_start: Application information:
I (301) cpu_start: Project name: lvgl-demo
I (306) cpu_start: App version: v2.0-68-gcffa173-dirty
I (313) cpu_start: Compile time: Apr 24 2023 17:00:46
I (319) cpu_start: ELF file SHA256: d5d3d50c2a493b36...
I (325) cpu_start: ESP-IDF: -128-NOTFOUND
I (330) cpu_start: Min chip rev: v0.0
I (335) cpu_start: Max chip rev: v3.99
I (340) cpu_start: Chip rev: v1.0
I (345) heap_init: Initializing. RAM available for dynamic allocation:
I (352) heap_init: At 3FFAE6E0 len 00001920 (6 KiB): DRAM
I (358) heap_init: At 3FFBAD68 len 00025298 (148 KiB): DRAM
I (364) heap_init: At 3FFE0440 len 00003AE0 (14 KiB): D/IRAM
I (370) heap_init: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM
I (377) heap_init: At 4008D2A0 len 00012D60 (75 KiB): IRAM
I (384) spi_flash: detected chip: generic
I (388) spi_flash: flash io: dio
I (393) cpu_start: Starting scheduler on PRO CPU.
I (0) cpu_start: Starting scheduler on APP CPU.
I (40) lvgl_helpers: Display hor size: 128, ver size: 160
I (40) lvgl_helpers: Display buffer size: 5120
I (40) lvgl_helpers: Initializing SPI master for display
I (50) lvgl_helpers: Configuring SPI host HSPI_HOST (1)
I (60) lvgl_helpers: MISO pin: -1, MOSI pin: 13, SCLK pin: 14, IO2/WP pin: -1, IO3/HD pin: -1
I (60) lvgl_helpers: Max transfer size: 10240 (bytes)
I (70) lvgl_helpers: Initializing SPI bus...
I (80) disp_spi: Adding SPI device
I (80) disp_spi: Clock speed: 40000000Hz, mode: 0, CS pin: 15
I (90) gpio: GPIO[2]| InputEn: 0| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0
I (100) gpio: GPIO[4]| InputEn: 0| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0
I (320) ILI9341: Initialization.
I (540) ILI9341: Display orientation: PORTRAIT
I (540) ILI9341: 0x36 command value: 0x48
Code to reproduce
The given example with the following sdkconfig (58.2 KB) where I matched the pins and the display resolution.
Here my questions
- Is this display supported?
- If yes, what kind of error I’m encountering?
- Is there a way to fix it?
Thank you for your help
There seems to be a mismatch of dispay resolution.
You setup lvgl for 128 x 160 and as display driver the ILI9341.
But as far as I can see, the ILI9341 is used for 240 x 320 displays.
1 Like
Thank you for your reply. I searched for the model of my display so I found that it is called ST7735 so I choose ST7735S.
Fistly I got the following errors when compiling:
C:/Users/Filippo/Documents/Espressif/lv_port_esp32/components/lvgl_esp32_drivers/lvgl_tft/st7735s.h:31:22: error: 'CONFIG_LV_AXP192_PIN_SDA' undeclared (first use in this function); did you mean 'CONFIG_LV_DISP_PIN_SDA'?
#define AXP192_SDA CONFIG_LV_AXP192_PIN_SDA
^~~~~~~~~~~~~~~~~~~~~~~~
C:/Users/Filippo/Documents/Espressif/lv_port_esp32/components/lvgl_esp32_drivers/lvgl_tft/st7735s.c:222:25: note: in expansion of macro 'AXP192_SDA'
.sda_io_num = AXP192_SDA,
^~~~~~~~~~
C:/Users/Filippo/Documents/Espressif/lv_port_esp32/components/lvgl_esp32_drivers/lvgl_tft/st7735s.h:31:22: note: each undeclared identifier is reported only once for each function it appears in
#define AXP192_SDA CONFIG_LV_AXP192_PIN_SDA
^~~~~~~~~~~~~~~~~~~~~~~~
C:/Users/Filippo/Documents/Espressif/lv_port_esp32/components/lvgl_esp32_drivers/lvgl_tft/st7735s.c:222:25: note: in expansion of macro 'AXP192_SDA'
.sda_io_num = AXP192_SDA,
^~~~~~~~~~
C:/Users/Filippo/Documents/Espressif/lv_port_esp32/components/lvgl_esp32_drivers/lvgl_tft/st7735s.h:32:22: error: 'CONFIG_LV_AXP192_PIN_SCL' undeclared (first use in this function); did you mean 'CONFIG_LV_DISP_PIN_SCL'?
#define AXP192_SCL CONFIG_LV_AXP192_PIN_SCL
^~~~~~~~~~~~~~~~~~~~~~~~
C:/Users/Filippo/Documents/Espressif/lv_port_esp32/components/lvgl_esp32_drivers/lvgl_tft/st7735s.c:223:25: note: in expansion of macro 'AXP192_SCL'
.scl_io_num = AXP192_SCL,
^~~~~~~~~~
At top level:
C:/Users/Filippo/Documents/Espressif/lv_port_esp32/components/lvgl_esp32_drivers/lvgl_tft/st7735s.c:250:13: warning: 'axp192_init' defined but not used [-Wunused-function]
static void axp192_init()
^~~~~~~~~~~
C:/Users/Filippo/Documents/Espressif/lv_port_esp32/components/lvgl_esp32_drivers/lvgl_tft/st7735s.c:218:13: warning: 'i2c_master_init' defined but not used [-Wunused-function]
static void i2c_master_init()
^~~~~~~~~~~~~~~
ninja: build stopped: subcommand failed.
So I removed these lines, from the drivers folder. Then the compilation has been successful. But when the firmware starts, the screen is stuck showing something similar to the previous picture. In the terminal I see:
I (0) cpu_start: App cpu up.
I (260) cpu_start: Pro cpu start user code
I (260) cpu_start: cpu freq: 160000000
I (260) cpu_start: Application information:
I (265) cpu_start: Project name: lvgl-demo
I (270) cpu_start: App version: v2.0-68-gcffa173-dirty
I (276) cpu_start: Compile time: Apr 26 2023 17:51:50
I (282) cpu_start: ELF file SHA256: d40a0fa4aae86d37...
I (288) cpu_start: ESP-IDF: -128-NOTFOUND
I (294) cpu_start: Min chip rev: v0.0
I (298) cpu_start: Max chip rev: v3.99
I (303) cpu_start: Chip rev: v1.0
I (308) heap_init: Initializing. RAM available for dynamic allocation:
I (315) heap_init: At 3FFAE6E0 len 00001920 (6 KiB): DRAM
I (321) heap_init: At 3FFBAB00 len 00025500 (149 KiB): DRAM
I (327) heap_init: At 3FFE0440 len 00003AE0 (14 KiB): D/IRAM
I (334) heap_init: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM
I (340) heap_init: At 4008D2A0 len 00012D60 (75 KiB): IRAM
I (348) spi_flash: detected chip: generic
I (351) spi_flash: flash io: dio
I (356) cpu_start: Starting scheduler on PRO CPU.
I (0) cpu_start: Starting scheduler on APP CPU.
I (40) lvgl_helpers: Display hor size: 128, ver size: 160
I (40) lvgl_helpers: Display buffer size: 5120
I (40) lvgl_helpers: Initializing SPI master for display
I (50) lvgl_helpers: Configuring SPI host HSPI_HOST (1)
I (60) lvgl_helpers: MISO pin: -1, MOSI pin: 13, SCLK pin: 14, IO2/WP pin: -1, IO3/HD pin: -1
I (60) lvgl_helpers: Max transfer size: 10240 (bytes)
I (70) lvgl_helpers: Initializing SPI bus...
I (80) disp_spi: Adding SPI device
I (80) disp_spi: Clock speed: 40000000Hz, mode: 0, CS pin: 15
I (90) gpio: GPIO[2]| InputEn: 0| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0
I (100) gpio: GPIO[4]| InputEn: 0| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0
I (320) ST7735S: ST7735S initialization.
So I suppose this display is not supported yet.
I think I will buy the ILI9341 display…
Is this right?
I (288) cpu_start: ESP-IDF: -128-NOTFOUND
As a suggestion remove the breadboard and wire the ESP32 devkit directly to the display. You can end up with all kinds of issues if the jumper wires and the breadboard are not making the best contact. I have had this happen on more than one occasion.
You can also make sure that the connections are good and tight as well. It should be pretty hard to push the jumper wire into the board. if there is little to no resistance when pushing the wire into the board that means the contacts inside the board have spread too much for the jumper wires you are using. This happens from variations in pin sizes between headers and wires. You can change where things are plugged in to make sure the connections are good and tight.
I can now update this topic.
I bought a touch display ILI9341 240x320. I ran the example only changing the settings of the horizontal and vertical size.
Now it shows exactly the demo contents!
A drawback when using the other display (1.8TFT SPI 128x160) was the different type of controller. I tried to change the controller (from ILI9341 to ST7735), but there were some errors during compiling due to the library, so I suspended the development with this type of display.
Here the error:
In file included from C:/Users/Filippo/Documents/Espressif/lv_port_esp32/components/lvgl_esp32_drivers/lvgl_tft/st7735s.c:9:
C:/Users/Filippo/Documents/Espressif/lv_port_esp32/components/lvgl_esp32_drivers/lvgl_tft/st7735s.c: In function 'i2c_master_init':
C:/Users/Filippo/Documents/Espressif/lv_port_esp32/components/lvgl_esp32_drivers/lvgl_tft/st7735s.h:31:22: error: 'CONFIG_LV_AXP192_PIN_SDA' undeclared (first use in this function); did you mean 'CONFIG_LV_DISP_PIN_SDA'?
#define AXP192_SDA CONFIG_LV_AXP192_PIN_SDA
^~~~~~~~~~~~~~~~~~~~~~~~
C:/Users/Filippo/Documents/Espressif/lv_port_esp32/components/lvgl_esp32_drivers/lvgl_tft/st7735s.c:222:25: note: in expansion of macro 'AXP192_SDA'
.sda_io_num = AXP192_SDA,
^~~~~~~~~~
C:/Users/Filippo/Documents/Espressif/lv_port_esp32/components/lvgl_esp32_drivers/lvgl_tft/st7735s.h:31:22: note: each undeclared identifier is reported only once for each function it appears in
#define AXP192_SDA CONFIG_LV_AXP192_PIN_SDA
^~~~~~~~~~~~~~~~~~~~~~~~
C:/Users/Filippo/Documents/Espressif/lv_port_esp32/components/lvgl_esp32_drivers/lvgl_tft/st7735s.c:222:25: note: in expansion of macro 'AXP192_SDA'
.sda_io_num = AXP192_SDA,
^~~~~~~~~~
C:/Users/Filippo/Documents/Espressif/lv_port_esp32/components/lvgl_esp32_drivers/lvgl_tft/st7735s.h:32:22: error: 'CONFIG_LV_AXP192_PIN_SCL' undeclared (first use in this function); did you mean 'CONFIG_LV_DISP_PIN_SCL'?
#define AXP192_SCL CONFIG_LV_AXP192_PIN_SCL
^~~~~~~~~~~~~~~~~~~~~~~~
C:/Users/Filippo/Documents/Espressif/lv_port_esp32/components/lvgl_esp32_drivers/lvgl_tft/st7735s.c:223:25: note: in expansion of macro 'AXP192_SCL'
.scl_io_num = AXP192_SCL,
^~~~~~~~~~
At top level:
C:/Users/Filippo/Documents/Espressif/lv_port_esp32/components/lvgl_esp32_drivers/lvgl_tft/st7735s.c:250:13: warning: 'axp192_init' defined but not used [-Wunused-function]
static void axp192_init()
^~~~~~~~~~~
C:/Users/Filippo/Documents/Espressif/lv_port_esp32/components/lvgl_esp32_drivers/lvgl_tft/st7735s.c:218:13: warning: 'i2c_master_init' defined but not used [-Wunused-function]
static void i2c_master_init()
^~~~~~~~~~~~~~~
[1291/1300] Building C object esp-idf/lvgl_esp32_drive...s/__idf_lvgl_esp32_drivers.dir/lvgl_tft/disp_spi.c.obj
ninja: build stopped: subcommand failed.
If you have any type of advice I’ll be happy to solve also this problem!
Are you sure that there are no differences between ST7735 and ST7735S?
However it seems very strange that this library doesn’t support this display…