Adafruit GFX and ESP8266

Hi,

I’m unable to compile example sketch from Adafruit_ST7789 library. It uses Adafruit GFX. During compile process I receive errors like this:

.pio\libdeps\d1_mini_pro\GFX Library for Arduino\src\Arduino_TFT.cpp: In member function 'virtual void Arduino_TFT::drawChar(int16_t, int16_t, unsigned char, uint16_t, uint16_t)':
.pio\libdeps\d1_mini_pro\GFX Library for Arduino\src\Arduino_TFT.cpp:1120:1: error: a15 cannot be used in asm here
 }
 ^
.pio\libdeps\d1_mini_pro\GFX Library for Arduino\src\Arduino_TFT.cpp:1120:1: error: a15 cannot be used in asm here
*** [.pio\build\d1_mini_pro\lib114\GFX Library for Arduino\Arduino_TFT.cpp.o] Error 1

How to resolve this problem.

CONFIGURATION: https://docs.platformio.org/page/boards/espressif8266/d1_mini_pro.html
PLATFORM: Espressif 8266 (2.6.3) > WeMos D1 mini Pro
HARDWARE: ESP8266 80MHz, 80KB RAM, 16MB Flash       
PACKAGES:
 - framework-arduinoespressif8266 3.20704.0 (2.7.4) 
 - tool-esptool 1.413.0 (4.13)
 - tool-esptoolpy 1.30000.201119 (3.0.0)
 - toolchain-xtensa 2.40802.200502 (4.8.2)
LDF: Library Dependency Finder -> http://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 35 compatible libraries
Scanning dependencies...
Dependency Graph
|-- <Adafruit ST7735 and ST7789 Library> 1.6.1
|   |-- <Adafruit GFX Library> 1.10.6
|   |   |-- <SPI> 1.0
|   |   |-- <Adafruit BusIO> 1.7.2
|   |   |   |-- <Wire> 1.0
|   |   |   |-- <SPI> 1.0
|   |   |-- <Wire> 1.0
|   |-- <SPI> 1.0
|-- <GFX Library for Arduino> 1.0.7
|   |-- <SPI> 1.0
|-- <Adafruit BusIO> 1.7.2
|   |-- <Wire> 1.0
|   |-- <SPI> 1.0
|-- <Adafruit seesaw Library> 1.3.1
|   |-- <Wire> 1.0
|-- <Adafruit GFX Library> 1.10.6
|   |-- <SPI> 1.0
|   |-- <Adafruit BusIO> 1.7.2
|   |   |-- <Wire> 1.0
|   |   |-- <SPI> 1.0
|   |-- <Wire> 1.0
|-- <SPI> 1.0
|-- <Wire> 1.0

How does this library get in here? This is not Adafruit’s GFX library, at least by name.

What’s the full platformio.ini with which this is reproducable?

My platformio.ini

[env:d1_mini_pro]
platform = espressif8266
board = d1_mini_pro
framework = arduino
monitor_speed = 115200
lib_deps = 
	adafruit/Adafruit ST7735 and ST7789 Library@^1.6.1
	moononournation/GFX Library for Arduino@^1.0.7
	adafruit/Adafruit BusIO@^1.7.2
	adafruit/Adafruit seesaw Library@^1.3.1

I’m getting the same erorr as you. I’m using your platformio.ini, I place the graphicstest.ino in my src/ folder and add

#include <Arduino.h>
#include <Wire.h>

at the top, and the result is

.pio\libdeps\d1_mini_pro\GFX Library for Arduino\src\Arduino_TFT.cpp: In member function 'virtual void Arduino_TFT::drawChar(int16_t, int16_t, unsigned char, uint16_t, uint16_t)':
.pio\libdeps\d1_mini_pro\GFX Library for Arduino\src\Arduino_TFT.cpp:1125:1: error: a15 cannot be used in asm here
 }
 ^

The issue is that this GFX Library for Arduino is somehow being pulled in when it shouldn’t be.

Adding

lib_ignore = GFX Library for Arduino

to the platformio.ini makes it work again.

I’ll open an issue at the core about that.

Issue opened per PIO finds "GFX Library for Arduino" library, breaks Adafruit GFX firmwares · Issue #3899 · platformio/platformio-core · GitHub, until then workaround is in place.

Thank you very much! It’s working :slight_smile: