Closed C47D closed 2 years ago
It seems to me that those gpio
functions are in this path https://github.com/espressif/esp-idf/blob/master/components/esp_rom/include/esp32/rom/gpio.h, I will investigate if the proper way to use them is via the suggested functions, such as esp_rom_gpio_pad_select_gpio
, all of those GPIO initialization are now done in display_bsp_init_io
and should be removed from the drivers init function.
SPI_DMA_CH1
is not defined for ESP32C3 https://github.com/espressif/esp-idf/blob/18af031791608460b65097eb5326aa28e7778d5f/components/driver/include/driver/spi_common.h#L69-L76, this line needs to be updated https://github.com/lvgl/lvgl_esp32_drivers/blob/6af2ab1f1c9b39b1d176c0b804842791b9689cae/lvgl_helpers.c#L107
This check should be done before calling lvgl_spi_driver_init
#if defined (CONFIG_IDF_TARGET_ESP32C3)
dma_channel = SPI_DMA_CH_AUTO;
#endif
EDIT
lvgl_interface_init
needs a nice cleanup
I've thought this part:
#if defined (CONFIG_IDF_TARGET_ESP32C3)
dma_channel = SPI_DMA_CH_AUTO;
#endif
already been added in #153.
@arktrin Yup, it is, but we currently do the following inside lvgl_interface_init
:
lvgl_spi_driver_init(TFT_SPI_HOST,
miso, DISP_SPI_MOSI, DISP_SPI_CLK,
spi_max_transfer_size, SPI_DMA_CH1,
DISP_SPI_IO2, DISP_SPI_IO3);
The SPI_DMA_CH1
symbol is not defined for ESP32C3, so it fails the compilation. The check added in #153 should be done before calling lvgl_spi_driver_init
instead of inside.
@arktrin I've pushed this branch fix/cleanup_lvgl_helpers
with a bunch of the errors you pointed out fixed, can you try it?
@C47D I don't know what I'm doing wrong but now I can't even configure the feat/new_driver_test
branch of lv_port_esp32
project. This is true for the 4.3 release and the latest master
branch of esp-idf. Also true for latest fix/cleanup_lvgl_helpers
and develop
branches of lvgl_esp32_drivers
.
Here is the content of CMakeOutput.log. Can't figure out which parts are related to errors.
Thanks @arktrin I will try to add check it later today.
@C47D Sorry! I forgot to recursively clone the repository. Now with the latest feat/new_driver_test
branch of lv_port_esp32
and with the latest fix/cleanup_lvgl_helpers
branch of the lvgl_esp32_drivers
I'm getting single error:
../main/main.c: In function 'guiTask':
../main/main.c:85:25: error: 'st7789_flush' undeclared (first use in this function)
disp_drv.flush_cb = st7789_flush;
^~~~~~~~~~~~
../main/main.c:85:25: note: each undeclared identifier is reported only once for each function it appears in
../main/main.c:94:5: error: implicit declaration of function 'st7789_init' [-Werror=implicit-function-declaration]
st7789_init(&disp_drv);
^~~~~~~~~~~
EDIT This is true for the 4.3 release and the latest master branch of esp-idf.
Damn, I wonder why I don't get those errors, maybe I need to test on a recently cloned repo. Will try to fix it later today, it's just a header include.
Sorry again! In a hurry I forgot to properly configure the project. Now I've got these errors:
../components/lvgl_esp32_drivers/lvgl_tft/esp_lcd_backlight.c: In function 'disp_backlight_new':
../components/lvgl_esp32_drivers/lvgl_tft/esp_lcd_backlight.c:59:9: error: implicit declaration of function 'gpio_matrix_out'; did you mean 'gpio_iomux_out'? [-Werror=implicit-function-declaration]
gpio_matrix_out(config->gpio_num, ledc_periph_signal[LEDC_LOW_SPEED_MODE].sig_out0_idx + config->channel_idx, config->output_invert, 0);
^~~~~~~~~~~~~~~
gpio_iomux_out
../components/lvgl_esp32_drivers/lvgl_tft/esp_lcd_backlight.c:65:9: error: implicit declaration of function 'gpio_pad_select_gpio'; did you mean 'esp_rom_gpio_pad_select_gpio'? [-Werror=implicit-function-declaration]
gpio_pad_select_gpio(config->gpio_num);
^~~~~~~~~~~~~~~~~~~~
esp_rom_gpio_pad_select_gpio
../components/lvgl_esp32_drivers/lvgl_tft/esp_lcd_backlight.c:67:43: error: 'SIG_GPIO_OUT_IDX' undeclared (first use in this function); did you mean 'GPIO_NUM_MAX'?
gpio_matrix_out(config->gpio_num, SIG_GPIO_OUT_IDX, config->output_invert, false);
^~~~~~~~~~~~~~~~
GPIO_NUM_MAX
../components/lvgl_esp32_drivers/lvgl_tft/esp_lcd_backlight.c:67:43: note: each undeclared identifier is reported only once for each function it appears in
../components/lvgl_esp32_drivers/lvgl_tft/FT81x.c: In function 'FT81x_init':
../components/lvgl_esp32_drivers/lvgl_tft/FT81x.c:266:2: error: implicit declaration of function 'gpio_pad_select_gpio'; did you mean 'esp_rom_gpio_pad_select_gpio'? [-Werror=implicit-function-declaration]
gpio_pad_select_gpio(EVE_PDN);
^~~~~~~~~~~~~~~~~~~~
esp_rom_gpio_pad_select_gpio
../components/lvgl_esp32_drivers/lvgl_tft/il3820.c: In function 'il3820_init':
../components/lvgl_esp32_drivers/lvgl_tft/il3820.c:199:5: error: implicit declaration of function 'gpio_pad_select_gpio'; did you mean 'esp_rom_gpio_pad_select_gpio'? [-Werror=implicit-function-declaration]
gpio_pad_select_gpio(IL3820_DC_PIN);
^~~~~~~~~~~~~~~~~~~~
esp_rom_gpio_pad_select_gpio
No problem, thanks for the update, I wonder why I don't see that errors in the CI
Can we close this?
Yes, we can.
Issue still exists when tested on IDF version 5.0
@C47D Thanks a lot! But with a latest develop now I've got even larger number of errors:
_Originally posted by @arktrin in https://github.com/lvgl/lvgl_esp32_drivers/issues/164#issuecomment-1009696098_