Hello everyone,
I’m having a persistent issue trying to get the TFT_eSPI library to compile for a Waveshare ESP32-C6-LCD-1.47 board in PlatformIO. No matter which configuration method I try, I consistently get the same compiler error:
.pio/libdeps/ESP32_C6_env/TFT_eSPI/Processors/TFT_eSPI_ESP32.c:17:31: error: 'VSPI' was not declared in this scope; did you mean 'SPI'?
This error indicates that the library is trying to build for an older ESP32 model and is not recognizing the necessary flags to use the modern driver for RISC-V chips like the ESP32-C6.
What I Have Tried:
-
User_Setup.hMethod: CreatingUser_Setup.handUser_Setup_Select.hfiles in the.pio/libdeps/TFT_eSPIfolder with the correct C6 definitions. -
platformio.iniBuild Flags: Forcing all settings viabuild_flags, including the critical-D ESP32_S3_MODE=1and-D USER_SETUP_LOADED=1. -
Local Library: Copying the entire
TFT_eSPIlibrary into my project’slibfolder and placing the configuration files directly inside it. -
Changing Platform Versions: I have tried using both the latest official
platform = espressif32and a specific community version (pioarduino). -
Full Clean: Between every attempt, I have run the “Clean” command and manually deleted the entire
.piofolder to ensure no cached files are being used.
Despite these efforts, the compiler seems to be ignoring the configuration and always falls back to the default, incompatible driver.
Has anyone found a definitive method to force TFT_eSPI to compile correctly for the ESP32-C6 within PlatformIO? It feels like something in the build environment is overriding all configuration attempts.
Here is my most recent platformio.ini:
[env:ESP32_C6_env]
platform = espressif32@^6.5.0
board = esp32-c6-devkitm-1
framework = arduino
monitor_speed = 115200
lib_deps =
h2zero/NimBLE-Arduino
bodmer/TFT_eSPI
build_flags =
; --- Flags for ESP32-C6 USB ---
-D ARDUINO_USB_MODE=1
-D ARDUINO_USB_CDC_ON_BOOT=1
Any help would be greatly appreciated!