PlatformIO Community

Adafruit SPIDevice conflict

Hello, I’ve been working with this libraries for a few weeks know and know when i try to compile my project that uses Adafruit LedBackpack i get this error:

Adafruit_SPIDevice.h:82:71: error: could not convert '& ASPI' from 'ASPI_t*' to 'SPIClass*'

I have the project i coded but I’ve also done a minimal code to see where it crashes and it happens as soon as i #include <Adafruit_LEDBackpack.h>.

This is my platformio.ini:

[platformio]
default_envs = debug

[env:release]
platform = atmelsam
board = due
framework = arduino
lib_ldf_mode = deep
lib_extra_dirs = ../../libs, ../../external
lib_deps = 
  adafruit/Adafruit DRV2605 Library@^1.2.0
  adafruit/Adafruit BusIO @ ^1.11.5
  https://github.com/adafruit/Adafruit_LED_Backpack.git
  adafruit/Adafruit GFX Library @ ^1.11.0
monitor_speed = 115200

[env:debug]
platform = atmelsam
board = due
framework = arduino
lib_ldf_mode = deep
lib_extra_dirs = ../../libs, ../../external
lib_deps = 	
  adafruit/Adafruit DRV2605 Library@^1.2.0
  adafruit/Adafruit BusIO @ ^1.11.5
  https://github.com/adafruit/Adafruit_LED_Backpack.git
  adafruit/Adafruit GFX Library @ ^1.11.0
monitor_speed = 115200
build_flags = -DDEBUG=1

What’s the minimal code with which this issue can be reproduced?

MinimalMachin.h:

// Audio Includes
#include <SdFat.h>
#include <AudioI2S.h>

// Touch Screen Includes
#include <GD2.h>

// Motor Includes
#include <Adafruit_DRV2605.h>

// Visual Includes
#include <Adafruit_LEDBackpack.h>

#include <DueFlashStorage.h>

main.cpp:

#include "MachineTest.h"

void setup(){
    
}

void loop(){

}

So basically i get an error when importing <Adafruit_LEDBackpack.h>. If i want to build other projects that were working on debug environment, with a release environment i get the same error.

Basically just importing <Adafruit_LEDBackpack.h> I’m getting an error

I cannot reproduce this issue with

[env:due]
platform = atmelsam
board = due
framework = arduino
lib_deps = 	
  https://github.com/adafruit/Adafruit_LED_Backpack.git

and code

#include <Arduino.h>
#include <Adafruit_LEDBackpack.h>

Adafruit_8x8matrix matrix = Adafruit_8x8matrix();

void setup() { }

void loop() {}

builds fine

Processing due (platform: atmelsam; board: due; framework: arduino)
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/atmelsam/due.html
PLATFORM: Atmel SAM (8.0.0) > Arduino Due (Programming Port)
HARDWARE: AT91SAM3X8E 84MHz, 96KB RAM, 512KB Flash
DEBUG: Current (atmel-ice) External (atmel-ice, blackmagic, jlink, stlink)
PACKAGES:
 - framework-arduino-sam @ 1.6.12
 - framework-cmsis @ 1.40500.0 (4.5.0)
 - framework-cmsis-atmel @ 1.2.2
 - toolchain-gccarmnoneeabi @ 1.70201.0 (7.2.1)
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 11 compatible libraries
Scanning dependencies...
Dependency Graph
|-- Adafruit LED Backpack Library @ 1.3.2+sha.508c0e6
|   |-- Adafruit BusIO @ 1.11.6
|   |   |-- Wire @ 1.0
|   |   |-- SPI @ 1.0
|   |-- Wire @ 1.0
|   |-- Adafruit GFX Library @ 1.11.2
|   |   |-- Adafruit BusIO @ 1.11.6
|   |   |   |-- Wire @ 1.0
|   |   |   |-- SPI @ 1.0
|   |   |-- Wire @ 1.0
|   |   |-- SPI @ 1.0
|   |-- SPI @ 1.0
|-- Adafruit GFX Library @ 1.11.2
|   |-- Adafruit BusIO @ 1.11.6
|   |   |-- Wire @ 1.0
|   |   |-- SPI @ 1.0
|   |-- Wire @ 1.0
|   |-- SPI @ 1.0
|-- Adafruit BusIO @ 1.11.6
|   |-- Wire @ 1.0
|   |-- SPI @ 1.0
|-- Wire @ 1.0
|-- SPI @ 1.0
Building in release mode
Compiling .pio\build\due\src\main.cpp.o
Compiling .pio\build\due\libd0b\Wire\Wire.cpp.o
Compiling .pio\build\due\lib0e2\SPI\SPI.cpp.o
Compiling .pio\build\due\lib1d6\Adafruit BusIO\Adafruit_BusIO_Register.cpp.o
Compiling .pio\build\due\lib1d6\Adafruit BusIO\Adafruit_I2CDevice.cpp.o
Compiling .pio\build\due\lib1d6\Adafruit BusIO\Adafruit_SPIDevice.cpp.o
Compiling .pio\build\due\lib57e\Adafruit GFX Library\Adafruit_GFX.cpp.o
In file included from C:\Users\Max Gerhardt\.platformio\packages\framework-arduino-sam\libraries\Wire\src\Wire.cpp:25:0:
C:\Users\Max Gerhardt\.platformio\packages\framework-arduino-sam\libraries\Wire\src\Wire.h: In constructor 'TwoWire::TwoWire(Twi*, void (*)(), void (*)())':
C:\Users\Max Gerhardt\.platformio\packages\framework-arduino-sam\libraries\Wire\src\Wire.h:96:7: warning: 'TwoWire::twi' will be initialized after [-Wreorder]
  Twi *twi;
       ^~~
C:\Users\Max Gerhardt\.platformio\packages\framework-arduino-sam\libraries\Wire\src\Wire.h:72:10: warning:   'uint8_t TwoWire::rxBufferIndex' [-Wreorder]
  uint8_t rxBufferIndex;
          ^~~~~~~~~~~~~
C:\Users\Max Gerhardt\.platformio\packages\framework-arduino-sam\libraries\Wire\src\Wire.cpp:95:1: warning:   when initialized here [-Wreorder]
 TwoWire::TwoWire(Twi *_twi, void(*_beginCb)(void), void(*_endCb)(void)) :
 ^~~~~~~
In file included from C:\Users\Max Gerhardt\.platformio\packages\framework-arduino-sam\libraries\Wire\src\Wire.cpp:25:0:
C:\Users\Max Gerhardt\.platformio\packages\framework-arduino-sam\libraries\Wire\src\Wire.h:108:16: warning: 'TwoWire::status' will be initialized after [-Wreorder]
  TwoWireStatus status;
                ^~~~~~
C:\Users\Max Gerhardt\.platformio\packages\framework-arduino-sam\libraries\Wire\src\Wire.h:90:30: warning:   'void (* TwoWire::onBeginCallback)()' [-Wreorder]
  void (*onBeginCallback)(void);
                              ^
C:\Users\Max Gerhardt\.platformio\packages\framework-arduino-sam\libraries\Wire\src\Wire.cpp:95:1: warning:   when initialized here [-Wreorder]
 TwoWire::TwoWire(Twi *_twi, void(*_beginCb)(void), void(*_endCb)(void)) :
 ^~~~~~~
Compiling .pio\build\due\lib57e\Adafruit GFX Library\Adafruit_GrayOLED.cpp.o
Compiling .pio\build\due\lib57e\Adafruit GFX Library\Adafruit_SPITFT.cpp.o
Compiling .pio\build\due\lib57e\Adafruit GFX Library\glcdfont.c.o
Compiling .pio\build\due\libd4c\Adafruit LED Backpack Library\Adafruit_LEDBackpack.cpp.o
Compiling .pio\build\due\FrameworkArduinoVariant\variant.cpp.o
Compiling .pio\build\due\FrameworkArduino\IPAddress.cpp.o
Compiling .pio\build\due\FrameworkArduino\Print.cpp.o
Compiling .pio\build\due\FrameworkArduino\Reset.cpp.o
Compiling .pio\build\due\FrameworkArduino\RingBuffer.cpp.o
Archiving .pio\build\due\lib0e2\libSPI.a
Archiving .pio\build\due\libd0b\libWire.a
Compiling .pio\build\due\FrameworkArduino\Stream.cpp.o
Compiling .pio\build\due\FrameworkArduino\UARTClass.cpp.o
Compiling .pio\build\due\FrameworkArduino\USARTClass.cpp.o
Compiling .pio\build\due\FrameworkArduino\USB\CDC.cpp.o
Archiving .pio\build\due\lib1d6\libAdafruit BusIO.a
Compiling .pio\build\due\FrameworkArduino\USB\PluggableUSB.cpp.o
Compiling .pio\build\due\FrameworkArduino\USB\USBCore.cpp.o
Compiling .pio\build\due\FrameworkArduino\WInterrupts.c.o
Compiling .pio\build\due\FrameworkArduino\WMath.cpp.o
Compiling .pio\build\due\FrameworkArduino\WString.cpp.o
Archiving .pio\build\due\libFrameworkArduinoVariant.a
Compiling .pio\build\due\FrameworkArduino\abi.cpp.o
Compiling .pio\build\due\FrameworkArduino\avr\dtostrf.c.o
Compiling .pio\build\due\FrameworkArduino\cortex_handlers.c.o
Compiling .pio\build\due\FrameworkArduino\hooks.c.o
Compiling .pio\build\due\FrameworkArduino\iar_calls_sam3.c.o
Compiling .pio\build\due\FrameworkArduino\itoa.c.o
C:\Users\Max Gerhardt\.platformio\packages\framework-arduino-sam\cores\arduino\USB\USBCore.cpp: In function 'void USB_ISR()':
C:\Users\Max Gerhardt\.platformio\packages\framework-arduino-sam\cores\arduino\USB\USBCore.cpp:688:21: warning: this 'else' clause does not guard... [-Wmisleading-indentation]
                     else
                     ^~~~
C:\Users\Max Gerhardt\.platformio\packages\framework-arduino-sam\cores\arduino\USB\USBCore.cpp:690:9: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'else'
         UDD_Send8(EP0, 0);
         ^~~~~~~~~
Archiving .pio\build\due\libd4c\libAdafruit LED Backpack Library.a
Compiling .pio\build\due\FrameworkArduino\main.cpp.o
Compiling .pio\build\due\FrameworkArduino\new.cpp.o
Compiling .pio\build\due\FrameworkArduino\syscalls_sam3.c.o
Compiling .pio\build\due\FrameworkArduino\watchdog.cpp.o
Compiling .pio\build\due\FrameworkArduino\wiring.c.o
Compiling .pio\build\due\FrameworkArduino\wiring_analog.c.o
Compiling .pio\build\due\FrameworkArduino\wiring_digital.c.o
Compiling .pio\build\due\FrameworkArduino\wiring_pulse.cpp.o
Compiling .pio\build\due\FrameworkArduino\wiring_pulse_asm.S.o
Compiling .pio\build\due\FrameworkArduino\wiring_shift.c.o
Archiving .pio\build\due\lib57e\libAdafruit GFX Library.a
Archiving .pio\build\due\libFrameworkArduino.a
Linking .pio\build\due\firmware.elf
Checking size .pio\build\due\firmware.elf
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
RAM:   [          ]   3.0% (used 2980 bytes from 98304 bytes)
Flash: [=         ]   5.1% (used 26664 bytes from 524288 bytes)
Building .pio\build\due\firmware.bin
============================================================================== [SUCCESS] Took 4.63 seconds ==============================================================================

Can you reproduce that?

Even with

[env:due]
platform = atmelsam
board = due
framework = arduino
lib_deps = 
  adafruit/Adafruit DRV2605 Library@^1.2.0
  adafruit/Adafruit BusIO @ ^1.11.5
  https://github.com/adafruit/Adafruit_LED_Backpack.git
  adafruit/Adafruit GFX Library @ ^1.11.0

and

#include <Arduino.h>
#include <Adafruit_SPIDevice.h>
#include <Adafruit_DRV2605.h>
#include <Adafruit_LEDBackpack.h>

Adafruit_8x8matrix matrix = Adafruit_8x8matrix();

void setup() { }

void loop() {}

no error.

I did a clean install of all repos with a new computer and had the same problem. Maybe if you install also SdFat, Audio and GD2?

GD2 is the problem.

.pio\libdeps\due\gd2-lib/GD2.h:133:13: error: conflicting declaration 'SPIClass ASPI'
 #define SPI ASPI

just redefining the crucial SPI object to ASPI in the header… what is this library thinking?

Reordering the includes solves it though.

#include <Arduino.h>
#include <SdFat.h>
#include <Adafruit_SPIDevice.h>
#include <Adafruit_DRV2605.h>
#include <Adafruit_LEDBackpack.h>
#include <DueFlashStorage.h>
#include <GD2.h>

Adafruit_8x8matrix matrix = Adafruit_8x8matrix();

void setup() { }

void loop() {}

with


[env:due]
platform = atmelsam
board = due
framework = arduino
lib_deps = 
  adafruit/Adafruit DRV2605 Library@^1.2.0
  adafruit/Adafruit BusIO @ ^1.11.5
  https://github.com/adafruit/Adafruit_LED_Backpack.git
  adafruit/Adafruit GFX Library @ ^1.11.0
  https://github.com/maxgerhardt/gd2-lib.git
  greiman/SdFat@^2.1.2
  https://github.com/fraimondo/DueFlashStorage.git

but this is a HUGE code smell on why GD2.h is doing that.

Other parts lower in the code which try to access “SPI” but get this weird “ASPI” object will be problematic though.

I’ve updated my version of the GD2 lib to solve this properly: GitHub - maxgerhardt/gd2-lib: Gameduino 2/3/3X library sources

You can use that with the same platformio.ini above, just delete the .pio folder prior to rebuilding so that it pulls the latest version. Then the SPI redefine only happens in the one cpp file that needs it.

I included your GS2 library (which i already manually had installed) in the platformio, i changed the #include <GD2.h> at the end of includes.

But now I am getting this error:

In file included from /Users/$$/Repos/Bing-Project/libs/BingUI/src/BingUIClass.cpp:2:0:
.pio/libdeps/debug/gd2-lib/GD2.h: In member function 'void sdcard::desel()':
.pio/libdeps/debug/gd2-lib/GD2.h:179:5: error: 'SPI' was not declared in this scope
     SPI.transfer(0xff); // force DO release
     ^~~
.pio/libdeps/debug/gd2-lib/GD2.h:179:5: note: suggested alternative: 'ASPI'
     SPI.transfer(0xff); // force DO release
     ^~~
     ASPI
.pio/libdeps/debug/gd2-lib/GD2.h: In member function 'void sdcard::sd_delay(byte)':
.pio/libdeps/debug/gd2-lib/GD2.h:183:7: error: 'SPI' was not declared in this scope
       SPI.transfer(0xff);
       ^~~
.pio/libdeps/debug/gd2-lib/GD2.h:183:7: note: suggested alternative: 'ASPI'
       SPI.transfer(0xff);
       ^~~
       ASPI
.pio/libdeps/debug/gd2-lib/GD2.h: In member function 'void sdcard::cmd(byte, uint32_t, uint8_t)':
.pio/libdeps/debug/gd2-lib/GD2.h:197:5: error: 'SPI' was not declared in this scope
     SPI.transfer(0x40 | cmd);
     ^~~
.pio/libdeps/debug/gd2-lib/GD2.h:197:5: note: suggested alternative: 'ASPI'
     SPI.transfer(0x40 | cmd);
     ^~~
     ASPI
.pio/libdeps/debug/gd2-lib/GD2.h: In member function 'byte sdcard::response()':
.pio/libdeps/debug/gd2-lib/GD2.h:207:9: error: 'SPI' was not declared in this scope
     r = SPI.transfer(0xff);
         ^~~
.pio/libdeps/debug/gd2-lib/GD2.h:207:9: note: suggested alternative: 'ASPI'
     r = SPI.transfer(0xff);
         ^~~
         ASPI
.pio/libdeps/debug/gd2-lib/GD2.h: In member function 'byte sdcard::R1()':
.pio/libdeps/debug/gd2-lib/GD2.h:217:5: error: 'SPI' was not declared in this scope
     SPI.transfer(0xff);   // trailing byte
     ^~~
.pio/libdeps/debug/gd2-lib/GD2.h:217:5: note: suggested alternative: 'ASPI'
     SPI.transfer(0xff);   // trailing byte
     ^~~
     ASPI
.pio/libdeps/debug/gd2-lib/GD2.h: In member function 'byte sdcard::sdR3(uint32_t&)':
.pio/libdeps/debug/gd2-lib/GD2.h:224:26: error: 'SPI' was not declared in this scope
       ocr = (ocr << 8) | SPI.transfer(0xff);
                          ^~~
.pio/libdeps/debug/gd2-lib/GD2.h:224:26: note: suggested alternative: 'ASPI'
       ocr = (ocr << 8) | SPI.transfer(0xff);
                          ^~~
                          ASPI
.pio/libdeps/debug/gd2-lib/GD2.h:225:5: error: 'SPI' was not declared in this scope
     SPI.transfer(0xff);   // trailing byte
     ^~~
.pio/libdeps/debug/gd2-lib/GD2.h:225:5: note: suggested alternative: 'ASPI'
     SPI.transfer(0xff);   // trailing byte
     ^~~
     ASPI
.pio/libdeps/debug/gd2-lib/GD2.h: In member function 'byte sdcard::sdR7()':
.pio/libdeps/debug/gd2-lib/GD2.h:235:7: error: 'SPI' was not declared in this scope
       SPI.transfer(0xff);
       ^~~
.pio/libdeps/debug/gd2-lib/GD2.h:235:7: note: suggested alternative: 'ASPI'
       SPI.transfer(0xff);
       ^~~
       ASPI
.pio/libdeps/debug/gd2-lib/GD2.h: In member function 'void sdcard::begin(byte)':
.pio/libdeps/debug/gd2-lib/GD2.h:267:20: error: 'SPI' was not declared in this scope
       while ((r1 = SPI.transfer(0xff)) & 0x80)
                    ^~~
.pio/libdeps/debug/gd2-lib/GD2.h:267:20: note: suggested alternative: 'ASPI'
       while ((r1 = SPI.transfer(0xff)) & 0x80)
                    ^~~
                    ASPI
.pio/libdeps/debug/gd2-lib/GD2.h:271:7: error: 'SPI' was not declared in this scope
       SPI.transfer(0xff);   // trailing byte
       ^~~
.pio/libdeps/debug/gd2-lib/GD2.h:271:7: note: suggested alternative: 'ASPI'
       SPI.transfer(0xff);   // trailing byte
       ^~~
       ASPI
.pio/libdeps/debug/gd2-lib/GD2.h: In member function 'void sdcard::cmd17(uint32_t)':
.pio/libdeps/debug/gd2-lib/GD2.h:391:12: error: 'SPI' was not declared in this scope
     while (SPI.transfer(0xff) != 0xfe)
            ^~~
.pio/libdeps/debug/gd2-lib/GD2.h:391:12: note: suggested alternative: 'ASPI'
     while (SPI.transfer(0xff) != 0xfe)
            ^~~
            ASPI
.pio/libdeps/debug/gd2-lib/GD2.h: In member function 'void sdcard::rdn(byte*, uint32_t, uint16_t)':
.pio/libdeps/debug/gd2-lib/GD2.h:399:7: error: 'SPI' was not declared in this scope
       SPI.transfer(0xff);
       ^~~
.pio/libdeps/debug/gd2-lib/GD2.h:399:7: note: suggested alternative: 'ASPI'
       SPI.transfer(0xff);
       ^~~
       ASPI
.pio/libdeps/debug/gd2-lib/GD2.h:401:14: error: 'SPI' was not declared in this scope
       *d++ = SPI.transfer(0xff);
              ^~~
.pio/libdeps/debug/gd2-lib/GD2.h:401:14: note: suggested alternative: 'ASPI'
       *d++ = SPI.transfer(0xff);
              ^~~
              ASPI
.pio/libdeps/debug/gd2-lib/GD2.h:403:7: error: 'SPI' was not declared in this scope
       SPI.transfer(0xff);
       ^~~
.pio/libdeps/debug/gd2-lib/GD2.h:403:7: note: suggested alternative: 'ASPI'
       SPI.transfer(0xff);
       ^~~
       ASPI
.pio/libdeps/debug/gd2-lib/GD2.h: In member function 'void Reader::fetch512(byte*)':
.pio/libdeps/debug/gd2-lib/GD2.h:804:29: error: 'SPI' was not declared in this scope
     memset(dst, 0xff, 512); SPI.transfer(dst, 512);
                             ^~~
.pio/libdeps/debug/gd2-lib/GD2.h:804:29: note: suggested alternative: 'ASPI'
     memset(dst, 0xff, 512); SPI.transfer(dst, 512);
                             ^~~
                             ASPI
/Users/$$$/Repos/Bing-Project/libs/BingUI/src/BingUIClass.cpp: In member function 'void BingUIClass::_options()':
/Users/$$$/Repos/Bing-Project/libs/BingUI/src/BingUIClass.cpp:778:30: warning: format '%lu' expects argument of type 'long unsigned int', but argument 4 has type 'int' [-Wformat=]
                         value);

BingUI is another library that uses GD2, but it is imported after BingMachine (The one where i changed the order of includes)

This library I manually install my fork from Git because i need to make manual changes to it. Does it matter for this issue?

I don’t think so, since the fault originates from the GD2 library.

Then apparenlty, from what i read in the last error i sent, it is looking for ASPI object.

My bad, indeed there are still references to SPI that I haven’t seen… Will do a better fix.

Could you please again delete the .pio and rebuild, I’ve made a few more changes.

I’ll put the full output just in case

Processing debug (platform: atmelsam; board: duelow; framework: arduino)
--------------------------------------------------------------------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/atmelsam/duelow.html
PLATFORM: Atmel SAM (7.1.0) > Arduino Due (Low Bootloader)
HARDWARE: AT91SAM3X8E 84MHz, 96KB RAM, 512KB Flash
DEBUG: Current (atmel-ice) External (atmel-ice, blackmagic, jlink, stlink)
PACKAGES: 
 - framework-arduino-sam @ 1.6.12 
 - framework-cmsis @ 1.40500.0 (4.5.0) 
 - framework-cmsis-atmel @ 1.2.2 
 - toolchain-gccarmnoneeabi @ 1.70201.0 (7.2.1)
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ deep, Compatibility ~ soft
Found 22 compatible libraries
Scanning dependencies...
Dependency Graph
|-- Adafruit DRV2605 Library @ 1.2.0
|   |-- Adafruit BusIO @ 1.11.6
|   |   |-- Wire @ 1.0
|   |   |-- SPI @ 1.0
|-- Adafruit BusIO @ 1.11.6
|   |-- Wire @ 1.0
|   |-- SPI @ 1.0
|-- Adafruit LED Backpack Library @ 1.3.2+sha.508c0e6
|   |-- Adafruit GFX Library @ 1.11.2
|   |   |-- Adafruit BusIO @ 1.11.6
|   |   |   |-- Wire @ 1.0
|   |   |   |-- SPI @ 1.0
|   |   |-- SPI @ 1.0
|   |   |-- Wire @ 1.0
|   |-- Adafruit BusIO @ 1.11.6
|   |   |-- Wire @ 1.0
|   |   |-- SPI @ 1.0
|-- Adafruit GFX Library @ 1.11.2
|   |-- Adafruit BusIO @ 1.11.6
|   |   |-- Wire @ 1.0
|   |   |-- SPI @ 1.0
|   |-- SPI @ 1.0
|   |-- Wire @ 1.0
|-- gd2-lib @ 1.3.4+sha.8440ff6
|   |-- SPI @ 1.0
|-- BingMachine
|   |-- SdFat @ 1.1.0
|   |   |-- SPI @ 1.0
|   |-- ArduinoMD5
|   |-- DueFlashStorage @ 1.0.0
|   |-- Adafruit DRV2605 Library @ 1.2.0
|   |   |-- Adafruit BusIO @ 1.11.6
|   |   |   |-- Wire @ 1.0
|   |   |   |-- SPI @ 1.0
|   |-- Adafruit BusIO @ 1.11.6
|   |   |-- Wire @ 1.0
|   |   |-- SPI @ 1.0
|   |-- Adafruit LED Backpack Library @ 1.3.2+sha.508c0e6
|   |   |-- Adafruit GFX Library @ 1.11.2
|   |   |   |-- Adafruit BusIO @ 1.11.6
|   |   |   |   |-- Wire @ 1.0
|   |   |   |   |-- SPI @ 1.0
|   |   |   |-- SPI @ 1.0
|   |   |   |-- Wire @ 1.0
|   |   |-- Adafruit BusIO @ 1.11.6
|   |   |   |-- Wire @ 1.0
|   |   |   |-- SPI @ 1.0
|   |-- Adafruit GFX Library @ 1.11.2
|   |   |-- Adafruit BusIO @ 1.11.6
|   |   |   |-- Wire @ 1.0
|   |   |   |-- SPI @ 1.0
|   |   |-- SPI @ 1.0
|   |   |-- Wire @ 1.0
|   |-- BingUI @ 0.2
|   |   |-- gd2-lib @ 1.3.4+sha.8440ff6
|   |   |   |-- SPI @ 1.0
|   |-- AudioI2S @ 1.0.1
|   |   |-- SdFat @ 1.1.0
|   |   |   |-- SPI @ 1.0
|   |-- gd2-lib @ 1.3.4+sha.8440ff6
|   |   |-- SPI @ 1.0
|-- BingUI @ 0.2
|   |-- gd2-lib @ 1.3.4+sha.8440ff6
|   |   |-- SPI @ 1.0
Building in release mode
Compiling .pio/build/debug/src/main.cpp.o
Compiling .pio/build/debug/libdff/Wire/Wire.cpp.o
Compiling .pio/build/debug/lib01f/SPI/SPI.cpp.o
Compiling .pio/build/debug/lib839/Adafruit BusIO/Adafruit_BusIO_Register.cpp.o
Compiling .pio/build/debug/lib839/Adafruit BusIO/Adafruit_I2CDevice.cpp.o
Compiling .pio/build/debug/lib839/Adafruit BusIO/Adafruit_SPIDevice.cpp.o
Compiling .pio/build/debug/libfc2/Adafruit DRV2605 Library/Adafruit_DRV2605.cpp.o
Compiling .pio/build/debug/lib41d/Adafruit GFX Library/Adafruit_GFX.cpp.o
In file included from src/main.cpp:3:0:
/Users/ivanmindlin/Repos/Bing-Project/libs/BingMachine/src/debug.h:5:2: warning: #warning "Using DEBUG features" [-Wcpp]
 #warning "Using DEBUG features"
  ^~~~~~~
In file included from /Users/ivanmindlin/.platformio/packages/framework-arduino-sam/libraries/Wire/src/Wire.cpp:25:0:
/Users/ivanmindlin/.platformio/packages/framework-arduino-sam/libraries/Wire/src/Wire.h: In constructor 'TwoWire::TwoWire(Twi*, void (*)(), void (*)())':
/Users/ivanmindlin/.platformio/packages/framework-arduino-sam/libraries/Wire/src/Wire.h:96:7: warning: 'TwoWire::twi' will be initialized after [-Wreorder]
  Twi *twi;
       ^~~
/Users/ivanmindlin/.platformio/packages/framework-arduino-sam/libraries/Wire/src/Wire.h:72:10: warning:   'uint8_t TwoWire::rxBufferIndex' [-Wreorder]
  uint8_t rxBufferIndex;
          ^~~~~~~~~~~~~
/Users/ivanmindlin/.platformio/packages/framework-arduino-sam/libraries/Wire/src/Wire.cpp:95:1: warning:   when initialized here [-Wreorder]
 TwoWire::TwoWire(Twi *_twi, void(*_beginCb)(void), void(*_endCb)(void)) :
 ^~~~~~~
In file included from /Users/ivanmindlin/.platformio/packages/framework-arduino-sam/libraries/Wire/src/Wire.cpp:25:0:
/Users/ivanmindlin/.platformio/packages/framework-arduino-sam/libraries/Wire/src/Wire.h:108:16: warning: 'TwoWire::status' will be initialized after [-Wreorder]
  TwoWireStatus status;
                ^~~~~~
/Users/ivanmindlin/.platformio/packages/framework-arduino-sam/libraries/Wire/src/Wire.h:90:30: warning:   'void (* TwoWire::onBeginCallback)()' [-Wreorder]
  void (*onBeginCallback)(void);
                              ^
/Users/ivanmindlin/.platformio/packages/framework-arduino-sam/libraries/Wire/src/Wire.cpp:95:1: warning:   when initialized here [-Wreorder]
 TwoWire::TwoWire(Twi *_twi, void(*_beginCb)(void), void(*_endCb)(void)) :
 ^~~~~~~
.pio/libdeps/debug/Adafruit DRV2605 Library/Adafruit_DRV2605.cpp: In member function 'boolean Adafruit_DRV2605::init()':
.pio/libdeps/debug/Adafruit DRV2605 Library/Adafruit_DRV2605.cpp:76:11: warning: unused variable 'id' [-Wunused-variable]
   uint8_t id = readRegister8(DRV2605_REG_STATUS);
           ^~
src/main.cpp:14:48: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
 char *  lang_folders[N_LANGS] = {"eng/", "spa/"};
                                                ^
src/main.cpp:14:48: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
src/main.cpp:15:61: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
 char *  type_folders[N_TYPES] = {"word/", "phrase/", "sent/"};
                                                             ^
src/main.cpp:15:61: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
src/main.cpp:15:61: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
Archiving .pio/build/debug/libfc2/libAdafruit DRV2605 Library.a
Indexing .pio/build/debug/libfc2/libAdafruit DRV2605 Library.a
Compiling .pio/build/debug/lib41d/Adafruit GFX Library/Adafruit_GrayOLED.cpp.o
Compiling .pio/build/debug/lib41d/Adafruit GFX Library/Adafruit_SPITFT.cpp.o
Compiling .pio/build/debug/lib41d/Adafruit GFX Library/glcdfont.c.o
Archiving .pio/build/debug/lib01f/libSPI.a
Archiving .pio/build/debug/libdff/libWire.a
Indexing .pio/build/debug/lib01f/libSPI.a
Indexing .pio/build/debug/libdff/libWire.a
Archiving .pio/build/debug/lib839/libAdafruit BusIO.a
Indexing .pio/build/debug/lib839/libAdafruit BusIO.a
Compiling .pio/build/debug/libf7a/Adafruit LED Backpack Library/Adafruit_LEDBackpack.cpp.o
Compiling .pio/build/debug/lib891/gd2-lib/GD2.cpp.o
Compiling .pio/build/debug/lib891/gd2-lib/GD2Terminal.cpp.o
Compiling .pio/build/debug/libe22/SdFatEx/FatLib/FatFile.cpp.o
Compiling .pio/build/debug/libe22/SdFatEx/FatLib/FatFileLFN.cpp.o
In file included from .pio/libdeps/debug/gd2-lib/GD2.cpp:40:0:
.pio/libdeps/debug/gd2-lib/transports/wiring.h: In member function 'void GDTransport::begin1()':
.pio/libdeps/debug/gd2-lib/transports/wiring.h:119:14: warning: unused variable 'x' [-Wunused-variable]
     uint16_t x = __rd16(0x0c0000UL);
              ^
Compiling .pio/build/debug/libe22/SdFatEx/FatLib/FatFilePrint.cpp.o
Compiling .pio/build/debug/libe22/SdFatEx/FatLib/FatFileSFN.cpp.o
Compiling .pio/build/debug/libe22/SdFatEx/FatLib/FatVolume.cpp.o
Compiling .pio/build/debug/libe22/SdFatEx/FatLib/FmtNumber.cpp.o
Archiving .pio/build/debug/lib41d/libAdafruit GFX Library.a
Archiving .pio/build/debug/libf7a/libAdafruit LED Backpack Library.a
Indexing .pio/build/debug/lib41d/libAdafruit GFX Library.a
Indexing .pio/build/debug/libf7a/libAdafruit LED Backpack Library.a
Compiling .pio/build/debug/libe22/SdFatEx/FatLib/StdioStream.cpp.o
Compiling .pio/build/debug/libe22/SdFatEx/FatLib/fstream.cpp.o
Compiling .pio/build/debug/libe22/SdFatEx/FatLib/istream.cpp.o
Compiling .pio/build/debug/libe22/SdFatEx/FatLib/ostream.cpp.o
Compiling .pio/build/debug/libe22/SdFatEx/MinimumSerial.cpp.o
Compiling .pio/build/debug/libe22/SdFatEx/SdCard/SdSpiCard.cpp.o
Compiling .pio/build/debug/libe22/SdFatEx/SdCard/SdSpiCardEX.cpp.o
Compiling .pio/build/debug/libe22/SdFatEx/SdCard/SdioCardEX.cpp.o
Compiling .pio/build/debug/libe22/SdFatEx/SdCard/SdioTeensy.cpp.o
Compiling .pio/build/debug/libe22/SdFatEx/SpiDriver/SdSpiESP8266.cpp.o
Compiling .pio/build/debug/libe22/SdFatEx/SpiDriver/SdSpiParticle.cpp.o
Compiling .pio/build/debug/libe22/SdFatEx/SpiDriver/SdSpiSAM3X.cpp.o
Compiling .pio/build/debug/libe22/SdFatEx/SpiDriver/SdSpiSTM32.cpp.o
Compiling .pio/build/debug/libe22/SdFatEx/SpiDriver/SdSpiTeensy3.cpp.o
Compiling .pio/build/debug/libf0d/ArduinoMD5/MD5.cpp.o
Compiling .pio/build/debug/libea1/DueFlashStorage/DueFlashStorage.cpp.o
Compiling .pio/build/debug/libea1/DueFlashStorage/efc.cpp.o
Compiling .pio/build/debug/libea1/DueFlashStorage/flash_efc.cpp.o
/Users/ivanmindlin/Repos/Bing-Project/external/DueFlashStorage/src/DueFlashStorage.cpp: In member function 'boolean DueFlashStorage::write(uint32_t, byte*, uint32_t, uint8_t)':
/Users/ivanmindlin/Repos/Bing-Project/external/DueFlashStorage/src/DueFlashStorage.cpp:63:19: warning: suggest parentheses around '+' in operand of '&' [-Wparentheses]
   if ((flash_start+offset & 3) != 0) {
        ~~~~~~~~~~~^~~~~~~
Compiling .pio/build/debug/lib759/BingUI/BingUI.cpp.o
/Users/ivanmindlin/Repos/Bing-Project/external/DueFlashStorage/src/flash_efc.cpp: In function 'uint32_t flash_is_locked(uint32_t, uint32_t)':
/Users/ivanmindlin/Repos/Bing-Project/external/DueFlashStorage/src/flash_efc.cpp:669:11: warning: variable 'ul_error' set but not used [-Wunused-but-set-variable]
  uint32_t ul_error;
           ^~~~~~~~
Compiling .pio/build/debug/lib759/BingUI/BingUIClass.cpp.o
Compiling .pio/build/debug/liba1e/Audio/AudioI2S.cpp.o
Archiving .pio/build/debug/libe22/libSdFatEx.a
In file included from /Users/ivanmindlin/Repos/Bing-Project/libs/BingUI/src/BingUIClass.cpp:5:0:
/Users/ivanmindlin/Repos/Bing-Project/libs/BingUI/src/debug.h:5:2: warning: #warning "Using DEBUG features" [-Wcpp]
 #warning "Using DEBUG features"
  ^~~~~~~
Indexing .pio/build/debug/libe22/libSdFatEx.a
Compiling .pio/build/debug/liba1e/Audio/DAC.cpp.o
Compiling .pio/build/debug/libb9b/BingMachine/BingMachine.cpp.o
/Users/ivanmindlin/Repos/Bing-Project/libs/BingUI/src/BingUIClass.cpp: In member function 'void BingUIClass::_options()':
/Users/ivanmindlin/Repos/Bing-Project/libs/BingUI/src/BingUIClass.cpp:778:30: warning: format '%lu' expects argument of type 'long unsigned int', but argument 4 has type 'int' [-Wformat=]
                         value);
                              ^
Archiving .pio/build/debug/lib891/libgd2-lib.a
Compiling .pio/build/debug/libb9b/BingMachine/BingMachineClass.cpp.o
Indexing .pio/build/debug/lib891/libgd2-lib.a
Compiling .pio/build/debug/libb9b/BingMachine/RandPerm.cpp.o
Archiving .pio/build/debug/libea1/libDueFlashStorage.a
Archiving .pio/build/debug/libf0d/libArduinoMD5.a
Indexing .pio/build/debug/libea1/libDueFlashStorage.a
Indexing .pio/build/debug/libf0d/libArduinoMD5.a
Compiling .pio/build/debug/libb9b/BingMachine/v3/BingMachineV3.cpp.o
Compiling .pio/build/debug/libb9b/BingMachine/v3/error.cpp.o
Compiling .pio/build/debug/FrameworkArduinoVariant/variant.cpp.o
Compiling .pio/build/debug/FrameworkArduino/IPAddress.cpp.o
In file included from /Users/ivanmindlin/Repos/Bing-Project/libs/BingMachine/src/v3/BingMachineV3.cpp:6:0:
/Users/ivanmindlin/Repos/Bing-Project/libs/BingMachine/src/v3/../debug.h:5:2: warning: #warning "Using DEBUG features" [-Wcpp]
 #warning "Using DEBUG features"
  ^~~~~~~
Compiling .pio/build/debug/FrameworkArduino/Print.cpp.o
Compiling .pio/build/debug/FrameworkArduino/Reset.cpp.o
Archiving .pio/build/debug/liba1e/libAudio.a
Indexing .pio/build/debug/liba1e/libAudio.a
/Users/ivanmindlin/Repos/Bing-Project/libs/BingMachine/src/v3/BingMachineV3.cpp: In function 'void reboot_to_flash1()':
/Users/ivanmindlin/Repos/Bing-Project/libs/BingMachine/src/v3/BingMachineV3.cpp:269:12: warning: unused variable 'EEFC_FCMD_CGPB' [-Wunused-variable]
  const int EEFC_FCMD_CGPB = 0x0C;
            ^~~~~~~~~~~~~~
Compiling .pio/build/debug/FrameworkArduino/RingBuffer.cpp.o
Compiling .pio/build/debug/FrameworkArduino/Stream.cpp.o
Compiling .pio/build/debug/FrameworkArduino/UARTClass.cpp.o
Compiling .pio/build/debug/FrameworkArduino/USARTClass.cpp.o
Archiving .pio/build/debug/libFrameworkArduinoVariant.a
Indexing .pio/build/debug/libFrameworkArduinoVariant.a
Compiling .pio/build/debug/FrameworkArduino/USB/CDC.cpp.o
Compiling .pio/build/debug/FrameworkArduino/USB/PluggableUSB.cpp.o
Archiving .pio/build/debug/lib759/libBingUI.a
Compiling .pio/build/debug/FrameworkArduino/USB/USBCore.cpp.o
Indexing .pio/build/debug/lib759/libBingUI.a
Compiling .pio/build/debug/FrameworkArduino/WInterrupts.c.o
Compiling .pio/build/debug/FrameworkArduino/WMath.cpp.o
/Users/ivanmindlin/.platformio/packages/framework-arduino-sam/cores/arduino/USB/USBCore.cpp: In function 'void USB_ISR()':
/Users/ivanmindlin/.platformio/packages/framework-arduino-sam/cores/arduino/USB/USBCore.cpp:688:21: warning: this 'else' clause does not guard... [-Wmisleading-indentation]
                     else
                     ^~~~
/Users/ivanmindlin/.platformio/packages/framework-arduino-sam/cores/arduino/USB/USBCore.cpp:690:9: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'else'
         UDD_Send8(EP0, 0);
         ^~~~~~~~~
Compiling .pio/build/debug/FrameworkArduino/WString.cpp.o
Compiling .pio/build/debug/FrameworkArduino/abi.cpp.o
Compiling .pio/build/debug/FrameworkArduino/avr/dtostrf.c.o
Archiving .pio/build/debug/libb9b/libBingMachine.a
Compiling .pio/build/debug/FrameworkArduino/cortex_handlers.c.o
Compiling .pio/build/debug/FrameworkArduino/hooks.c.o
Compiling .pio/build/debug/FrameworkArduino/iar_calls_sam3.c.o
Indexing .pio/build/debug/libb9b/libBingMachine.a
Compiling .pio/build/debug/FrameworkArduino/itoa.c.o
Compiling .pio/build/debug/FrameworkArduino/main.cpp.o
Compiling .pio/build/debug/FrameworkArduino/new.cpp.o
Compiling .pio/build/debug/FrameworkArduino/syscalls_sam3.c.o
Compiling .pio/build/debug/FrameworkArduino/watchdog.cpp.o
Compiling .pio/build/debug/FrameworkArduino/wiring.c.o
Compiling .pio/build/debug/FrameworkArduino/wiring_analog.c.o
Compiling .pio/build/debug/FrameworkArduino/wiring_digital.c.o
Compiling .pio/build/debug/FrameworkArduino/wiring_pulse.cpp.o
Compiling .pio/build/debug/FrameworkArduino/wiring_pulse_asm.S.o
Compiling .pio/build/debug/FrameworkArduino/wiring_shift.c.o
Archiving .pio/build/debug/libFrameworkArduino.a
Indexing .pio/build/debug/libFrameworkArduino.a
Linking .pio/build/debug/firmware.elf
.pio/build/debug/lib759/libBingUI.a(BingUIClass.cpp.o):(.bss.ASPI+0x0): multiple definition of `ASPI'
.pio/build/debug/src/main.cpp.o:(.bss.ASPI+0x0): first defined here
.pio/build/debug/libb9b/libBingMachine.a(BingMachine.cpp.o):(.bss.ASPI+0x0): multiple definition of `ASPI'
.pio/build/debug/src/main.cpp.o:(.bss.ASPI+0x0): first defined here
.pio/build/debug/libb9b/libBingMachine.a(BingMachineV3.cpp.o):(.bss.ASPI+0x0): multiple definition of `ASPI'
.pio/build/debug/src/main.cpp.o:(.bss.ASPI+0x0): first defined here
.pio/build/debug/lib891/libgd2-lib.a(GD2.cpp.o):(.bss.ASPI+0x0): multiple definition of `ASPI'
.pio/build/debug/src/main.cpp.o:(.bss.ASPI+0x0): first defined here
collect2: error: ld returned 1 exit status
*** [.pio/build/debug/firmware.elf] Error 1
======================================================== [FAILED] Took 5.50 seconds ========================================================

Environment    Status    Duration
-------------  --------  ------------
debug          FAILED    00:00:05.495
================================================== 1 failed, 0 succeeded in 00:00:05.495 ==================================================
The terminal process "platformio 'run', '--environment', 'debug'" terminated with exit code: 1.

Terminal will be reused by tasks, press any key to close it.

My bad, I made yet another mistake which I need to fix xD

Now it should actually work. Please remove the .pio folder again and rebuild.

No problem! You are absolutely saving my life

It worked!!

First, thanks a lot. Why did this error occur? What changed?

Second, to what annonymus location can i send i gift to thank all the help?