Comments (6)
add these lines under the define comment in file "lvgl_helpers.h" should work.
# define LV_HOR_RES_MAX 320
# define LV_VER_RES_MAX 240
# define SPI_HOST_MAX 3
from lvgl_esp32_drivers.
add these lines under the define comment in file "lvgl_helpers.h" should work.
# define LV_HOR_RES_MAX 320 # define LV_VER_RES_MAX 240 # define SPI_HOST_MAX 3
@xbzxsh Yes, I know! But I expect that the library handle this automatically.
from lvgl_esp32_drivers.
I saw this issue isn't closed yet, so I'm goint to write what I tried.
I'm a newcomer in LVGL and I'd like to develop a little project with the ESP32. However I noticed from the docs that It's not clear for which version is made the lvgl_esp32_drivers
.
I'm using the v4.4.1
version for ESP-IDF.
I created a very simple piece of code:
#include "lvgl.h"
int app_main(void)
{
lv_init();
return 0;
}
Directory for lvgl
library under components/lvgl
.
Directory for lvgl_esp32_drivers
under components/lvgl_esp32_drivers
at master
branch.
I started with the master branch for lvgl
and I found this error:
../components/lvgl/src/core/../libs/ffmpeg/../../../src/widgets/meter/lv_meter.h:22:2: error: #error "lv_meter: Complex drawing is required. Enable it in lv_conf.h (LV_USE_DRAW_MASKS 1)"
#error "lv_meter: Complex drawing is required. Enable it in lv_conf.h (LV_USE_DRAW_MASKS 1)"
^~~~~
In file included from ../components/lvgl/src/core/../libs/ffmpeg/lv_ffmpeg.h:15,
from ../components/lvgl/src/core/lv_obj.c:28:
../components/lvgl/src/core/../libs/ffmpeg/../../../lvgl.h:120:2: warning: #warning "You are using the development version of LVGL which is not stable at this moment. For production use the release/v8.3 branch. To silence this warning add #define LV_USE_DEV_VERSION to lv_conf.h" [-Wcpp]
#warning "You are using the development version of LVGL which is not stable at this moment. For production use the release/v8.3 branch. To silence this warning add #define LV_USE_DEV_VERSION to lv_conf.h"
^~~~~~~
I switched to release/v8.3
, here the resulting error, as a lot of people said:
../components/lvgl_esp32_drivers/lvgl_helpers.c: In function 'lvgl_driver_init':
../components/lvgl_esp32_drivers/lvgl_helpers.h:57:25: error: 'LV_HOR_RES_MAX' undeclared (first use in this function); did you mean 'LV_HOR_RES'?
#define DISP_BUF_SIZE (LV_HOR_RES_MAX * 40)
^~~~~~~~~~~~~~
C:/Espressif/frameworks/esp-idf-v4.4.1/components/log/include/esp_log.h:421:137: note: in expansion of macro 'DISP_BUF_SIZE'
if (level==ESP_LOG_ERROR ) { esp_log_write(ESP_LOG_ERROR, tag, LOG_FORMAT(E, format), esp_log_timestamp(), tag, ##__VA_ARGS__); } \
^~~~~~~~~~~
C:/Espressif/frameworks/esp-idf-v4.4.1/components/log/include/esp_log.h:443:41: note: in expansion of macro 'ESP_LOG_LEVEL'
if ( LOG_LOCAL_LEVEL >= level ) ESP_LOG_LEVEL(level, tag, format, ##__VA_ARGS__); \
^~~~~~~~~~~~~
C:/Espressif/frameworks/esp-idf-v4.4.1/components/log/include/esp_log.h:353:38: note: in expansion of macro 'ESP_LOG_LEVEL_LOCAL'
#define ESP_LOGI( tag, format, ... ) ESP_LOG_LEVEL_LOCAL(ESP_LOG_INFO, tag, format, ##__VA_ARGS__)
^~~~~~~~~~~~~~~~~~~
../components/lvgl_esp32_drivers/lvgl_helpers.c:61:5: note: in expansion of macro 'ESP_LOGI'
ESP_LOGI(TAG, "Display buffer size: %d", DISP_BUF_SIZE);
^~~~~~~~
../components/lvgl_esp32_drivers/lvgl_helpers.h:57:25: note: each undeclared identifier is reported only once for each function it appears in
#define DISP_BUF_SIZE (LV_HOR_RES_MAX * 40)
^~~~~~~~~~~~~~
C:/Espressif/frameworks/esp-idf-v4.4.1/components/log/include/esp_log.h:421:137: note: in expansion of macro 'DISP_BUF_SIZE'
if (level==ESP_LOG_ERROR ) { esp_log_write(ESP_LOG_ERROR, tag, LOG_FORMAT(E, format), esp_log_timestamp(), tag, ##__VA_ARGS__); } \
^~~~~~~~~~~
C:/Espressif/frameworks/esp-idf-v4.4.1/components/log/include/esp_log.h:443:41: note: in expansion of macro 'ESP_LOG_LEVEL'
if ( LOG_LOCAL_LEVEL >= level ) ESP_LOG_LEVEL(level, tag, format, ##__VA_ARGS__); \
^~~~~~~~~~~~~
C:/Espressif/frameworks/esp-idf-v4.4.1/components/log/include/esp_log.h:353:38: note: in expansion of macro 'ESP_LOG_LEVEL_LOCAL'
#define ESP_LOGI( tag, format, ... ) ESP_LOG_LEVEL_LOCAL(ESP_LOG_INFO, tag, format, ##__VA_ARGS__)
^~~~~~~~~~~~~~~~~~~
../components/lvgl_esp32_drivers/lvgl_helpers.c:61:5: note: in expansion of macro 'ESP_LOGI'
ESP_LOGI(TAG, "Display buffer size: %d", DISP_BUF_SIZE);
^~~~~~~~
In file included from c:\espressif\tools\tools\xtensa-esp32-elf\esp-2021r2-patch3-8.4.0\xtensa-esp32-elf\xtensa-esp32-elf\sys-include\sys\reent.h:503,
from C:/Espressif/frameworks/esp-idf-v4.4.1/components/newlib/platform_include/sys/reent.h:17,
from c:\espressif\tools\tools\xtensa-esp32-elf\esp-2021r2-patch3-8.4.0\xtensa-esp32-elf\xtensa-esp32-elf\sys-include\string.h:11,
from ../components/lvgl/src/misc/lv_mem.h:20,
from ../components/lvgl/lvgl.h:28,
from ../components/lvgl_esp32_drivers/lvgl_tft/disp_driver.h:16,
from ../components/lvgl_esp32_drivers/lvgl_helpers.h:18,
from ../components/lvgl_esp32_drivers/lvgl_helpers.c:10:
../components/lvgl_esp32_drivers/lvgl_helpers.c: In function 'lvgl_spi_driver_init':
../components/lvgl_esp32_drivers/lvgl_helpers.c:157:28: error: 'SPI_HOST_MAX' undeclared (first use in this function); did you mean 'GPIO_PORT_MAX'?
assert((0 <= host) && (SPI_HOST_MAX > host));
So I switched to the last version for v7 instead of using the newer v8, named v7.11.0
, but it showed this remaining error:
In file included from c:\espressif\tools\tools\xtensa-esp32-elf\esp-2021r2-patch3-8.4.0\xtensa-esp32-elf\xtensa-esp32-elf\sys-include\sys\reent.h:503,
from C:/Espressif/frameworks/esp-idf-v4.4.1/components/newlib/platform_include/sys/reent.h:17,
from c:\espressif\tools\tools\xtensa-esp32-elf\esp-2021r2-patch3-8.4.0\xtensa-esp32-elf\xtensa-esp32-elf\sys-include\string.h:11,
from ../components/lvgl/src/lv_hal/../lv_misc/lv_area.h:17,
from ../components/lvgl/src/lv_hal/lv_hal_disp.h:22,
from ../components/lvgl/src/lv_hal/lv_hal.h:16,
from ../components/lvgl/lvgl.h:30,
from ../components/lvgl_esp32_drivers/lvgl_tft/disp_driver.h:16,
from ../components/lvgl_esp32_drivers/lvgl_helpers.h:18,
from ../components/lvgl_esp32_drivers/lvgl_helpers.c:10:
../components/lvgl_esp32_drivers/lvgl_helpers.c: In function 'lvgl_spi_driver_init':
../components/lvgl_esp32_drivers/lvgl_helpers.c:157:28: error: 'SPI_HOST_MAX' undeclared (first use in this function); did you mean 'GPIO_PORT_MAX'?
assert((0 <= host) && (SPI_HOST_MAX > host));
It disappears if I write #define SPI_HOST_MAX 3
at the top of lvgl_helpers.h
, the code then completes the build process correctly.
Some suggestions:
- The documentation for
lvgl_esp32_drivers
in the README is not well written. I didn't find which version of LVGL I should use. - The definition of
SPI_HOST_MAX
in themaster
branch oflvgl_esp32_drivers
is missing. - For
lvgl_esp32_drivers
there aren't branches with names related to the versions of LVGL, apart ofdevelop/lvgl_7.11.0_idf_5.0
which I didn't try. - The given ready-to-use example
lv_port_esp32
at this link referres to this repo which is archived. Now we should use this instead. It doesn't return any compilation error becauseSPI_HOST_MAX
is not used in the functionlvgl_spi_driver_init()
insidelvgl_helpers.c
. Infact it doesn't use the lastmaster
forlvgl_esp32_drivers
, but the commit9fed1cc47b5a45fec6bae08b55d2147d3b50260c
instead.
Did anyone find the magic combination to make LVGL work with ESP32?
Related to this question: I didn't find a clear way to compile, as you can see.
I hope I shared useful elements to improve this library. Only a question remains: using the missing definitions, can I use the LVGL library without bad surprises?
from lvgl_esp32_drivers.
add these lines under the define comment in file "lvgl_helpers.h" should work.
# define LV_HOR_RES_MAX 320 # define LV_VER_RES_MAX 240 # define SPI_HOST_MAX 3@xbzxsh Yes, I know! But I expect that the library handle this automatically.
@xbzxsh, I agree with @mohammadjavadpirhadi, isn't this odd?
There used to be an #ifdef before, but now it isn't.
Wouldn't a KConfig setting be better there?
from lvgl_esp32_drivers.
Was there any resolution to this? In the other issue related to this, @kisvegabor said:
It's because the ESP related repos are still not updated to LVGL v8.
So I reverted components/lvgl
in my project to v7.9.1
.
Also, I'm using IDF v4.4.3
since the LVGL ESP32 docs say
ESP-IDF v4 framework is the suggested version to use.
Did anyone find the magic combination to make LVGL work with ESP32?
from lvgl_esp32_drivers.
I have an update.
@MrSurly I found that if I compile under the branch develop/lvgl_7.11.0_idf_5.0
of lvgl_esp32_drivers
it compiles without needing any type of variation inside the library. I'm still using ESP-IDF v4.4.1
.
I hope to be helpful.
EDIT: I've just seen that there is a merge request to solve the problem of missing defines. They updated the develop branch.
This enforce the fact that we should not use the master
branch for lvgl_esp32_drivers
.
from lvgl_esp32_drivers.
Related Issues (20)
- ili9488 i2sæ¥å£
- LVGL hello world example causes spurious interrupt
- SPI on ESP32-C3 does not work in develop branch HOT 1
- FT810 driver touch issues HOT 1
- XPT2046 from time to time does not work
- ST7735S driver with SPI is broken by AXP192 feature HOT 1
- ST7789V cannot be displayed vertically HOT 1
- Error with `EVE` on ESP32 - undeclared defs.
- When will you adapt to the ESP-IDF v5.x framework? HOT 2
- gpio_matrix_out is not defined HOT 6
- LVGL 8.3.7 & ESP-IDF 5.2 HOT 19
- spi_flash_write() replaced with esp_flash_write() HOT 1
- Wrong SPI Mode when using ST7789
- M5 Stack Core2 Touchscreen unexpected Values
- Random flickering and artefacts using st7789 display on esp32s3 8080 interface
- Image lv_img_set_angle of CF_ALPHA 1-2-4-8 bit bitmaps bug
- ESP32S3 SPI error: invalid dma channel, chip only support spi dma channel auto-alloc
- ILI9341 Display mirrored HOT 6
- ST7567S support (ex. gm12864 )
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
ð Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ððð
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google â€ïž Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lvgl_esp32_drivers.