Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Undefined reference to SPIClass::Write32(unsigned long) #3584

Open
Krki012 opened this issue Dec 17, 2024 · 0 comments
Open

Undefined reference to SPIClass::Write32(unsigned long) #3584

Krki012 opened this issue Dec 17, 2024 · 0 comments

Comments

@Krki012
Copy link

Krki012 commented Dec 17, 2024

Hi. I'm unable to resolve the issue with TFT_eSPI where library says something about SPIClass being an undefined reference. Here's the output to console in Arduino IDE:

c:/users/karlo/appdata/local/arduino15/packages/esp32/tools/esp-xs3/2302/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld.exe: C:\Users\karlo\AppData\Local\arduino\sketches\7CC87C69C809C73E4E1AF5CA8DB721B9\libraries\TFT_eSPI\TFT_eSPI.cpp.o:(.literal._ZN8TFT_eSPI9setWindowEllll+0x0): undefined reference to `SPIClass::write32(unsigned long)' c:/users/karlo/appdata/local/arduino15/packages/esp32/tools/esp-xs3/2302/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld.exe: C:\Users\karlo\AppData\Local\arduino\sketches\7CC87C69C809C73E4E1AF5CA8DB721B9\libraries\TFT_eSPI\TFT_eSPI.cpp.o: in function `TFT_eSPI::setWindow(long, long, long, long)': C:\Users\karlo\Documents\Arduino\libraries\TFT_eSPI/TFT_eSPI.cpp:3486: undefined reference to `SPIClass::write32(unsigned long)' c:/users/karlo/appdata/local/arduino15/packages/esp32/tools/esp-xs3/2302/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld.exe: C:\Users\karlo\Documents\Arduino\libraries\TFT_eSPI/TFT_eSPI.cpp:3488: undefined reference to `SPIClass::write32(unsigned long)' c:/users/karlo/appdata/local/arduino15/packages/esp32/tools/esp-xs3/2302/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld.exe: C:\Users\karlo\AppData\Local\arduino\sketches\7CC87C69C809C73E4E1AF5CA8DB721B9\libraries\TFT_eSPI\TFT_eSPI.cpp.o: in function `TFT_eSPI::drawPixel(long, long, unsigned long)': C:\Users\karlo\Documents\Arduino\libraries\TFT_eSPI/TFT_eSPI.cpp:3762: undefined reference to `SPIClass::write32(unsigned long)' c:/users/karlo/appdata/local/arduino15/packages/esp32/tools/esp-xs3/2302/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld.exe: C:\Users\karlo\Documents\Arduino\libraries\TFT_eSPI/TFT_eSPI.cpp:3769: undefined reference to `SPIClass::write32(unsigned long)' c:/users/karlo/appdata/local/arduino15/packages/esp32/tools/esp-xs3/2302/bin/../lib/gcc/xtensa-esp32s3-elf/12.2.0/../../../../xtensa-esp32s3-elf/bin/ld.exe: C:\Users\karlo\AppData\Local\arduino\sketches\7CC87C69C809C73E4E1AF5CA8DB721B9\libraries\TFT_eSPI\TFT_eSPI.cpp.o:C:\Users\karlo\Documents\Arduino\libraries\TFT_eSPI/TFT_eSPI.cpp:3562: more undefined references to `SPIClass::write32(unsigned long)' follow collect2.exe: error: ld returned 1 exit status Multiple libraries were found for "SPI.h" Used: C:\Users\karlo\Documents\Arduino\libraries\SPI Not used: C:\Users\karlo\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.0.7\libraries\SPI Using library SPI at version 2.0.0 in folder: C:\Users\karlo\Documents\Arduino\libraries\SPI Using library TFT_eSPI at version 2.5.43 in folder: C:\Users\karlo\Documents\Arduino\libraries\TFT_eSPI Using library FS at version 3.0.7 in folder: C:\Users\karlo\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.0.7\libraries\FS Using library SPIFFS at version 3.0.7 in folder: C:\Users\karlo\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.0.7\libraries\SPIFFS exit status 1

The code causing the issue is a demo example (any from the library but I need the TFT_graphics_one_lib from 480x320 folder)

My user_setup.h is as follows:


#define ILI9488_DRIVER     // WARNING: Do not connect ILI9488 display SDO to MISO if other devices share the SPI bus (TFT SDO does NOT tristate when CS is high)

// #define TFT_INVERSION_ON
#define TFT_INVERSION_OFF

#define TFT_BL   46            // LED back-light control pin
#define TFT_BACKLIGHT_ON HIGH  // Level to turn ON back-light (HIGH or LOW)

#define TFT_MISO 14
#define TFT_MOSI 13
#define TFT_SCLK 12
#define TFT_CS   3  // Chip select control pin
#define TFT_DC   42  // Data Command control pin
//#define TFT_RST   4  // Reset pin (could connect to RST pin)
#define TFT_RST  -1  // Set TFT_RST to -1 if display RESET is connected to ESP32 board RST

//#define TOUCH_CS 21     // Chip select pin (T_CS) of touch screen

#define LOAD_GLCD   // Font 1. Original Adafruit 8 pixel font needs ~1820 bytes in FLASH
#define LOAD_FONT2  // Font 2. Small 16 pixel high font, needs ~3534 bytes in FLASH, 96 characters
#define LOAD_FONT4  // Font 4. Medium 26 pixel high font, needs ~5848 bytes in FLASH, 96 characters
#define LOAD_FONT6  // Font 6. Large 48 pixel font, needs ~2666 bytes in FLASH, only characters 1234567890:-.apm
#define LOAD_FONT7  // Font 7. 7 segment 48 pixel font, needs ~2438 bytes in FLASH, only characters 1234567890:-.
#define LOAD_FONT8  // Font 8. Large 75 pixel font needs ~3256 bytes in FLASH, only characters 1234567890:-.
//#define LOAD_FONT8N // Font 8. Alternative to Font 8 above, slightly narrower, so 3 digits fit a 160 pixel TFT
#define LOAD_GFXFF  // FreeFonts. Include access to the 48 Adafruit_GFX free fonts FF1 to FF48 and custom fonts

// Comment out the #define below to stop the SPIFFS filing system and smooth font code being loaded
// this will save ~20kbytes of FLASH
#define SMOOTH_FONT

// #define SPI_FREQUENCY   1000000
// #define SPI_FREQUENCY   5000000
// #define SPI_FREQUENCY  10000000
// #define SPI_FREQUENCY  20000000
// #define SPI_FREQUENCY  27000000
#define SPI_FREQUENCY  40000000
// #define SPI_FREQUENCY  55000000 // STM32 SPI1 only (SPI2 maximum is 27MHz)
// #define SPI_FREQUENCY  80000000

// Optional reduced SPI frequency for reading TFT
#define SPI_READ_FREQUENCY  20000000

// The XPT2046 requires a lower SPI clock rate of 2.5MHz so we define that here:
#define SPI_TOUCH_FREQUENCY  2500000

// The ESP32 has 2 free SPI ports i.e. VSPI and HSPI, the VSPI is the default.
// If the VSPI port is in use and pins are not accessible (e.g. TTGO T-Beam)
// then uncomment the following line:
#define USE_HSPI_PORT

My biggest problem are these lines:

C:\Users\karlo\AppData\Local\arduino\sketches\7CC87C69C809C73E4E1AF5CA8DB721B9\libraries\TFT_eSPI\TFT_eSPI.cpp.o:C:\Users\karlo\Documents\Arduino\libraries\TFT_eSPI/TFT_eSPI.cpp:3562: more undefined references to `SPIClass::write32(unsigned long)' follow

collect2.exe: error: ld returned 1 exit status

Multiple libraries were found for "SPI.h"
Used: C:\Users\karlo\Documents\Arduino\libraries\SPI
Not used: C:\Users\karlo\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.0.7\libraries\SPI

Versions are 2.5.43 for library, 3.0.7 for board list (espresiff) and 2.3.4 for Arduino IDE

If it helps, I'm using ESP32S3-based Elecrow SPI display with ILI9488 driver: https://www.elecrow.com/wiki/esp-terminal-with-35inch-spi-capacitive-touch-display.html

I chose the ESP32S3 Dev Module in board manager (tried several others as well)

image

I found out that disabling the HSPI port reduces the number of errors but they still exist and it's still te undefined reference to SPIClass one

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant