GFX Library for Arduino and ESP32-S3 Compilation Issue

Been working on converting an Arduino IDE project to PlatformIO, and for whatever reason I’m having an issue with the GFX_Library_for_Arduino library that I’ve not been able to find a solution for.

platform.ini is as follows:

[env:touch-avionics]
platform = espressif32
board = adafruit_qualia_s3_rgb666
framework = arduino
lib_deps = 
	lvgl/lvgl@^9.2.2
	moononournation/GFX Library for Arduino@^1.5.1
	adafruit/Adafruit FT6206 Library@^1.1.0
build_flags = 
  	-D LV_CONF_PATH="${PROJECT_DIR}/include/lv_conf.h"

Imports for the project are:

#include <Arduino.h>
#include <Arduino_GFX_Library.h>
#include <Adafruit_FT6206.h>
#include "lv_conf.h"
#include <lvgl.h>
#include "USB.h"
#include "USBHIDKeyboard.h"
#include "button_background.c"

The error during compilation is:

.pio/libdeps/touch-avionics/GFX Library for Arduino/src/databus/Arduino_ESP32RGBPanel.cpp: In member function 'uint16_t* Arduino_ESP32RGBPanel::getFrameBuffer(int16_t, int16_t)':
.pio/libdeps/touch-avionics/GFX Library for Arduino/src/databus/Arduino_ESP32RGBPanel.cpp:93:3: error: 'esp_lcd_rgb_panel_config_t::<unnamed struct>' has no non-static data member named 'refresh_on_demand'
   };
   ^
.pio/libdeps/touch-avionics/GFX Library for Arduino/src/databus/Arduino_ESP32QSPI.cpp: In member function 'virtual bool Arduino_ESP32QSPI::begin(int32_t, int8_t)':
.pio/libdeps/touch-avionics/GFX Library for Arduino/src/databus/Arduino_ESP32QSPI.cpp:59:21: error: 'ESP_INTR_CPU_AFFINITY_AUTO' was not declared in this scope
       .isr_cpu_id = ESP_INTR_CPU_AFFINITY_AUTO,
                     ^~~~~~~~~~~~~~~~~~~~~~~~~~
*** [.pio\build\touch-avionics\libde0\GFX Library for Arduino\databus\Arduino_ESP32RGBPanel.cpp.o] Error 1
.pio/libdeps/touch-avionics/GFX Library for Arduino/src/databus/Arduino_ESP32QSPI.cpp:59:21: note: suggested alternative: 'ESP_ETH_PHY_ADDR_AUTO'
       .isr_cpu_id = ESP_INTR_CPU_AFFINITY_AUTO,
                     ^~~~~~~~~~~~~~~~~~~~~~~~~~
                     ESP_ETH_PHY_ADDR_AUTO
.pio/libdeps/touch-avionics/GFX Library for Arduino/src/databus/Arduino_ESP32QSPI.cpp:60:22: error: 'spi_bus_config_t' has no non-static data member named 'isr_cpu_id'
       .intr_flags = 0};
                      ^
.pio/libdeps/touch-avionics/GFX Library for Arduino/src/databus/Arduino_ESP32QSPI.cpp:73:23: error: 'SPI_CLK_SRC_DEFAULT' was not declared in this scope
       .clock_source = SPI_CLK_SRC_DEFAULT,
                       ^~~~~~~~~~~~~~~~~~~
.pio/libdeps/touch-avionics/GFX Library for Arduino/src/databus/Arduino_ESP32QSPI.cpp:73:23: note: suggested alternative: 'LCD_CLK_SRC_XTAL'
       .clock_source = SPI_CLK_SRC_DEFAULT,
                       ^~~~~~~~~~~~~~~~~~~
                       LCD_CLK_SRC_XTAL
.pio/libdeps/touch-avionics/GFX Library for Arduino/src/databus/Arduino_ESP32QSPI.cpp:83:25: error: 'spi_device_interface_config_t' has no non-static data member named 'clock_source'
       .post_cb = nullptr};
                         ^
*** [.pio\build\touch-avionics\libde0\GFX Library for Arduino\databus\Arduino_ESP32QSPI.cpp.o] Error 1

I can’t figure out why some of these functions and variables are not defined in PlatformIO, but are in the Arduino IDE. From what I can gather, I have everything I need, but being new to PlatformIO I’m hoping I just missed something simple.

The only place I can find a reference to ESP_INTR_CPU_AFFINITY_AUTO, for example, is in the esp-idf repository under spi_master.c, but as I understand it the Arduino implementation should be including everything from esp-idf. When I try to add the esp-idf framework to my project, I get errors about there being whitespace in the project path, which I’ve read is a limitation of the build system they have, which makes it incompatible with any Arduino library from what I can tell.

Thanks in advance!

If you want to compare to your ArduinoIDE Project, you have also to compare the Espressif Arduino Core version and the underlying ESP-IDF Version.

In PlatformIO, the Espressif Arduino Framework is only officially supported up to version 2.0.17.

An overview of the relationships between the PlatformIO Platform espressif32, the Espressif Arduino Core version and the underlying ESP-IDF version can be found in my list: platform-espressif32-versions.md

Thanks for the point in the right direction! To close the loop, this is what I did:

Through the grapevine, I discovered that the configuration for the adafruit_qualia_s3_rgb666 board in the pioarduino/platform-espressif32 project was incorrect, so I made a PR with the fix that will hopefully get merged into the project soon.

In the interim, I set up my project to use a release from my fork. My platformio.ini configuration now looks like this:

[env:touch-avionics]
platform = https://github.com/Sector95/platform-espressif32/archive/refs/tags/v0.0.1-dev.zip
board = adafruit_qualia_s3_rgb666
framework = arduino
lib_deps = 
	lvgl/lvgl@^9.2.2
	moononournation/GFX Library for Arduino@^1.5.1
	adafruit/Adafruit FT6206 Library@^1.1.0
build_flags = 
  	-D LV_CONF_PATH="${PROJECT_DIR}/include/lv_conf.h"

Project is now up-and-running!

I’m glad you found a solution. I wonder how a misspelled partition table can cause the error listed above? Am I missing something?

No reason for a complete fork.

Use a custom board manifest in your project until the issue has been fixed.
See Custom Embedded Boards — PlatformIO latest documentation

Your PR is for pioarduino only. This won’t fix the issue in platformio/platform-espressif32. It would be great if you would do the same PR there.

Sorry I wasn’t clear-- The root solution was that I needed to use pioarduino because I was depending on a more recent version than what was officially supported. Additionally, I ran into another issue that prevented it from compiling pioarduino for this board specifically, so I had to make a PR to fix that. It’s evidently a common misconfiguration issue with Adafruit boards, so I wanted to capture that detail in case someone else stumbled along after me.

That said, I see what you mean about the official repository also being incorrect. I’ll get a PR out there when I get a second!

1 Like