Implicit Declaration of Function 'gpio_pad_select_gpio'

Description

Hello, I downloaded the latest version.
When building lv_port_esp32 I am getting an implicit declaration error.

What MCU/Processor/Board and compiler are you using?

I am using an ST7789 Controller and ESP32 Devkit V1

Code to reproduce

.

FAILED: esp-idf/lvgl_esp32_drivers/CMakeFiles/__idf_lvgl_esp32_drivers.dir/lvgl_tft/ili9341.c.obj
/home/elycian/.espressif/tools/xtensa-esp32-elf/esp-2021r2-8.4.0/xtensa-esp32-elf/bin/xtensa-esp32-elf-gcc -DLV_CONF_INCLUDE_SIMPLE -DLV_LVGL_H_INCLUDE_SIMPLE -DMBEDTLS_CONFIG_FILE=“mbedtls/esp_config.h” -DUNITY_INCLUDE_CONFIG_H -DWITH_POSIX -Iconfig -I…/components/lvgl_esp32_drivers -I…/components/lvgl_esp32_drivers/lvgl_tft -I/home/elycian/esp/esp-idf/components/newlib/platform_include -I/home/elycian/esp/esp-idf/components/freertos/FreeRTOS-Kernel/include -I/home/elycian/esp/esp-idf/components/freertos/esp_additions/include/freertos -I/home/elycian/esp/esp-idf/components/freertos/FreeRTOS-Kernel/portable/xtensa/include -I/home/elycian/esp/esp-idf/components/freertos/esp_additions/include -I/home/elycian/esp/esp-idf/components/esp_hw_support/include -I/home/elycian/esp/esp-idf/components/esp_hw_support/include/soc -I/home/elycian/esp/esp-idf/components/esp_hw_support/include/soc/esp32 -I/home/elycian/esp/esp-idf/components/esp_hw_support/port/esp32/. -I/home/elycian/esp/esp-idf/components/heap/include -I/home/elycian/esp/esp-idf/components/log/include -I/home/elycian/esp/esp-idf/components/lwip/include/apps -I/home/elycian/esp/esp-idf/components/lwip/include/apps/sntp -I/home/elycian/esp/esp-idf/components/lwip/lwip/src/include -I/home/elycian/esp/esp-idf/components/lwip/port/esp32/include -I/home/elycian/esp/esp-idf/components/lwip/port/esp32/include/arch -I/home/elycian/esp/esp-idf/components/soc/include -I/home/elycian/esp/esp-idf/components/soc/esp32/. -I/home/elycian/esp/esp-idf/components/soc/esp32/include -I/home/elycian/esp/esp-idf/components/hal/esp32/include -I/home/elycian/esp/esp-idf/components/hal/include -I/home/elycian/esp/esp-idf/components/hal/platform_port/include -I/home/elycian/esp/esp-idf/components/esp_rom/include -I/home/elycian/esp/esp-idf/components/esp_rom/include/esp32 -I/home/elycian/esp/esp-idf/components/esp_rom/esp32 -I/home/elycian/esp/esp-idf/components/esp_common/include -I/home/elycian/esp/esp-idf/components/esp_system/include -I/home/elycian/esp/esp-idf/components/esp_system/port/soc -I/home/elycian/esp/esp-idf/components/esp_system/port/include/private -I/home/elycian/esp/esp-idf/components/xtensa/include -I/home/elycian/esp/esp-idf/components/xtensa/esp32/include -I/home/elycian/esp/esp-idf/components/driver/include -I/home/elycian/esp/esp-idf/components/driver/esp32/include -I/home/elycian/esp/esp-idf/components/driver/deprecated -I/home/elycian/esp/esp-idf/components/esp_pm/include -I/home/elycian/esp/esp-idf/components/esp_ringbuf/include -I/home/elycian/esp/esp-idf/components/efuse/include -I/home/elycian/esp/esp-idf/components/efuse/esp32/include -I/home/elycian/esp/esp-idf/components/vfs/include -I/home/elycian/esp/esp-idf/components/esp_wifi/include -I/home/elycian/esp/esp-idf/components/esp_event/include -I/home/elycian/esp/esp-idf/components/esp_netif/include -I/home/elycian/esp/esp-idf/components/esp_eth/include -I/home/elycian/esp/esp-idf/components/tcpip_adapter/include -I/home/elycian/esp/esp-idf/components/esp_phy/include -I/home/elycian/esp/esp-idf/components/esp_phy/esp32/include -I/home/elycian/esp/esp-idf/components/esp_timer/include -I…/components/lvgl -I…/components/lvgl/src -I/home/elycian/esp/esp-idf/components/mbedtls/port/include -I/home/elycian/esp/esp-idf/components/mbedtls/mbedtls/include -I/home/elycian/esp/esp-idf/components/mbedtls/esp_crt_bundle/include -I/home/elycian/esp/esp-idf/components/app_update/include -I/home/elycian/esp/esp-idf/components/spi_flash/include -I/home/elycian/esp/esp-idf/components/bootloader_support/include -I/home/elycian/esp/esp-idf/components/bootloader_support/bootloader_flash/include -I/home/elycian/esp/esp-idf/components/nvs_flash/include -I/home/elycian/esp/esp-idf/components/pthread/include -I/home/elycian/esp/esp-idf/components/wpa_supplicant/include -I/home/elycian/esp/esp-idf/components/wpa_supplicant/port/include -I/home/elycian/esp/esp-idf/components/wpa_supplicant/esp_supplicant/include -I/home/elycian/esp/esp-idf/components/app_trace/include -I/home/elycian/esp/esp-idf/components/asio/asio/asio/include -I/home/elycian/esp/esp-idf/components/asio/port/include -I/home/elycian/esp/esp-idf/components/unity/include -I/home/elycian/esp/esp-idf/components/unity/unity/src -I/home/elycian/esp/esp-idf/components/cmock/CMock/src -I/home/elycian/esp/esp-idf/components/coap/port/include -I/home/elycian/esp/esp-idf/components/coap/libcoap/include -I/home/elycian/esp/esp-idf/components/console -I/home/elycian/esp/esp-idf/components/http_parser -I/home/elycian/esp/esp-idf/components/esp-tls -I/home/elycian/esp/esp-idf/components/esp-tls/esp-tls-crypto -I/home/elycian/esp/esp-idf/components/esp_adc_cal/include -I/home/elycian/esp/esp-idf/components/esp_gdbstub/include -I/home/elycian/esp/esp-idf/components/esp_gdbstub/xtensa -I/home/elycian/esp/esp-idf/components/esp_gdbstub/esp32 -I/home/elycian/esp/esp-idf/components/esp_hid/include -I/home/elycian/esp/esp-idf/components/tcp_transport/include -I/home/elycian/esp/esp-idf/components/esp_http_client/include -I/home/elycian/esp/esp-idf/components/esp_http_server/include -I/home/elycian/esp/esp-idf/components/esp_https_ota/include -I/home/elycian/esp/esp-idf/components/esp_lcd/include -I/home/elycian/esp/esp-idf/components/esp_lcd/interface -I/home/elycian/esp/esp-idf/components/protobuf-c/protobuf-c -I/home/elycian/esp/esp-idf/components/protocomm/include/common -I/home/elycian/esp/esp-idf/components/protocomm/include/security -I/home/elycian/esp/esp-idf/components/protocomm/include/transports -I/home/elycian/esp/esp-idf/components/mdns/include -I/home/elycian/esp/esp-idf/components/esp_local_ctrl/include -I/home/elycian/esp/esp-idf/components/sdmmc/include -I/home/elycian/esp/esp-idf/components/esp_serial_slave_link/include -I/home/elycian/esp/esp-idf/components/esp_websocket_client/include -I/home/elycian/esp/esp-idf/components/espcoredump/include -I/home/elycian/esp/esp-idf/components/espcoredump/include/port/xtensa -I/home/elycian/esp/esp-idf/components/wear_levelling/include -I/home/elycian/esp/esp-idf/components/fatfs/diskio -I/home/elycian/esp/esp-idf/components/fatfs/vfs -I/home/elycian/esp/esp-idf/components/fatfs/src -I/home/elycian/esp/esp-idf/components/freemodbus/common/include -I/home/elycian/esp/esp-idf/components/idf_test/include -I/home/elycian/esp/esp-idf/components/idf_test/include/esp32 -I/home/elycian/esp/esp-idf/components/ieee802154/include -I/home/elycian/esp/esp-idf/components/json/cJSON -I/home/elycian/esp/esp-idf/components/mqtt/esp-mqtt/include -I/home/elycian/esp/esp-idf/components/openssl/include -I/home/elycian/esp/esp-idf/components/perfmon/include -I/home/elycian/esp/esp-idf/components/spiffs/include -I/home/elycian/esp/esp-idf/components/ulp/ulp_common/include -I/home/elycian/esp/esp-idf/components/ulp/ulp_common/include/esp32 -I/home/elycian/esp/esp-idf/components/wifi_provisioning/include -I…/components/lv_examples -mlongcalls -Wno-frame-address -ffunction-sections -fdata-sections -Wall -Werror=all -Wno-error=unused-function -Wno-error=unused-variable -Wno-error=deprecated-declarations -Wextra -Wno-unused-parameter -Wno-sign-compare -ggdb -Og -fmacro-prefix-map=/home/elycian/esp/lv_port_esp32=. -fmacro-prefix-map=/home/elycian/esp/esp-idf=/IDF -fstrict-volatile-bitfields -Wno-error=unused-but-set-variable -fno-jump-tables -fno-tree-switch-conversion -std=gnu99 -Wno-old-style-declaration -D_GNU_SOURCE -DIDF_VER=“v5.0-dev-1478-g6895a662aa” -DESP_PLATFORM -D_POSIX_READER_WRITER_LOCKS -MD -MT esp-idf/lvgl_esp32_drivers/CMakeFiles/__idf_lvgl_esp32_drivers.dir/lvgl_tft/ili9341.c.obj -MF esp-idf/lvgl_esp32_drivers/CMakeFiles/__idf_lvgl_esp32_drivers.dir/lvgl_tft/ili9341.c.obj.d -o esp-idf/lvgl_esp32_drivers/CMakeFiles/__idf_lvgl_esp32_drivers.dir/lvgl_tft/ili9341.c.obj -c …/components/lvgl_esp32_drivers/lvgl_tft/ili9341.c
…/components/lvgl_esp32_drivers/lvgl_tft/ili9341.c: In function ‘ili9341_init’:
…/components/lvgl_esp32_drivers/lvgl_tft/ili9341.c:94: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(ILI9341_DC);
^~~~~~~~~~~~~~~~~~~~
esp_rom_gpio_pad_select_gpio
cc1: some warnings being treated as errors
[1100/1110] Building C object esp-idf/lvgl_esp32_drivers/CMakeFiles/__idf_lvgl_esp32_drivers.dir/lvgl_helpers.c.obj
ninja: build stopped: subcommand failed.
ninja failed with exit code 1

I think I may have figured out the issue,

the driver/gpio.h in the esp_idf library that ili9341.c references is missing an include

add
#include “rom/gpio.g” to driver/gpio.h

this allows gpiod_pad_select_gpio to be declared

I’m not sure why others have not had this issue, may I have cloned the repository incorrectly?

I have had this issue too, thanks for your post.