Proper component setup with esp-idf
Posted: Sat Mar 04, 2023 3:32 pm
I am trying to make an lvgl project with esp32. I have started with the
https://docs.lvgl.io/master/get-started ... essif.html
that guides you to include in component folder the lvgl and lvgl_esp32_drivers as git submodules. The drivers project is needed for the displays but on build there are several problems.
I am using esp 5.0.1 stable release and release/v8.3 of lvgl also master branch of lvgl_esp32_drivers cause there is no release branch there.
All included headers from esp-idf framework in lvgl_esp32_drivers can not be identified like "driver/gpio.h" etc... Relative picture is
attached I do not know what is the proper way to fix this. the c_cpp_properties.json is the next
The CMakeList.txt file in the lvgl_esp32_drivers project has almost at the end this code.
Which i changes to
And fixed the issues of include.
Next problem was that in specific .c for ili9341.c ( sdkconfig by default has this as selected screen controller) i was getting error that
portTick_RATE_MS can not be identified and probably i need to change to portTick_PERIOD_MS. Since the first is defined to be the second i made the changes to the complete .c file and the problem was resolved.
After this next error i do not really know how to resolve :
1.
2.
https://docs.lvgl.io/master/get-started ... essif.html
that guides you to include in component folder the lvgl and lvgl_esp32_drivers as git submodules. The drivers project is needed for the displays but on build there are several problems.
I am using esp 5.0.1 stable release and release/v8.3 of lvgl also master branch of lvgl_esp32_drivers cause there is no release branch there.
All included headers from esp-idf framework in lvgl_esp32_drivers can not be identified like "driver/gpio.h" etc... Relative picture is
attached I do not know what is the proper way to fix this. the c_cpp_properties.json is the next
Code: Select all
{
"configurations": [
{
"name": "ESP-IDF",
"compilerPath": "/Users/kyrpav/.espressif/tools/xtensa-esp32-elf/esp-2022r1-11.2.0/xtensa-esp32-elf/bin/xtensa-esp32-elf-gcc",
"cStandard": "c11",
"cppStandard": "c++17",
"includePath": [
"${config:idf.espIdfPath}/components/**",
"${config:idf.espIdfPathWin}/components/**",
"${config:idf.espAdfPath}/components/**",
"${config:idf.espAdfPathWin}/components/**",
"${workspaceFolder}/**"
],
"browse": {
"path": [
"${config:idf.espIdfPath}/components",
"${config:idf.espIdfPathWin}/components",
"${config:idf.espAdfPath}/components/**",
"${config:idf.espAdfPathWin}/components/**",
"${workspaceFolder}"
],
"limitSymbolsToIncludedHeaders": false
},
"compileCommands": "${workspaceFolder}/build/compile_commands.json"
}
],
"version": 4
}
Code: Select all
idf_component_register(SRCS ${SOURCES}
INCLUDE_DIRS ${LVGL_INCLUDE_DIRS}
REQUIRES lvgl)
Code: Select all
idf_component_register(SRCS ${SOURCES}
INCLUDE_DIRS ${LVGL_INCLUDE_DIRS}
REQUIRES lvgl driver esp_common log freertos)
Next problem was that in specific .c for ili9341.c ( sdkconfig by default has this as selected screen controller) i was getting error that
portTick_RATE_MS can not be identified and probably i need to change to portTick_PERIOD_MS. Since the first is defined to be the second i made the changes to the complete .c file and the problem was resolved.
After this next error i do not really know how to resolve :
1.
Though "driver/gpio.h" is included properly the gpio function can not be identified. Which seems that what i ded with component register maybe is not enoughcomponents/lvgl_esp32_drivers/lvgl_tft/ili9341.c:84:5: error: implicit declaration of function 'gpio_pad_select_gpio'; did you mean 'esp_rom_gpio_pad_select_gpio'? [-Werror=implicit-function-declaration]
84 | gpio_pad_select_gpio(ILI9341_DC);
| ^~~~~~~~~~~~~~~~~~~~
| esp_rom_gpio_pad_select_gpio
2.
3.components/lvgl_esp32_drivers/lvgl_tft/esp_lcd_backlight.c:52:14: error: 'ledc_timer_config_t' has no member named 'bit_num'
52 | .bit_num = LEDC_TIMER_10_BIT,
components/lvgl_esp32_drivers/lvgl_tft/esp_lcd_backlight.c:67:43: error: 'SIG_GPIO_OUT_IDX' undeclared (first use in this function)
67 | gpio_matrix_out(config->gpio_num, SIG_GPIO_OUT_IDX, config->output_invert, false);