Well, ok, not totally minimal, but as soon as I include a display library, the build fails.
$ platformio --version PlatformIO, version 3.0.0.dev11 $ platformio init --ide clion --board teensy31 ... PlatformManager: Updating teensy @ ~0.0.0: Versions: Current=0.0.0, Latest=0.0.0 [Up-to-date] PackageManager: Updating framework-arduinoteensy @ ~1.128.0: Versions: Current=1.128.0, Latest=1.128.0 [Up-to-date] ... PlatformIO has been successfully upgraded to 3.0.0.dev11!
The offending source file:
$ cat src/cap.cpp #include <Arduino.h> #include <Adafruit_ST7735.h> #include <Adafruit_GFX.h>
void setup() { Serial.begin(19200); // USB, communication to PC or Mac while(!Serial) { digitalWriteFast(13u, HIGH); delay(20); } digitalWriteFast(13u, LOW); Serial.println("Connected."); }
void loop() {
}
Attempting to build:
$ platformio run --target upload [Mon Jul 25 21:13:25 2016] Processing teensy31 (platform: teensy, board: teensy31, framework: arduino) ------------------------------------------------------------------------------------------------------------------------------------------------------------------- Collecting 29 compatible libraries Looking for dependencies... Depends on <Robot Control> v1.0 Depends on <TFT> v1.0 Processing src/cap.cpp Processing .platformio/packages/framework-arduinoteensy/cores/teensy3/AudioStream.cpp ... In file included from /Users/robwills/.platformio/packages/framework-arduinoteensy/libraries/Robot_Control/src/Fat16.h:29:0, from /Users/robwills/.platformio/packages/framework-arduinoteensy/libraries/Robot_Control/src/SquawkSD.h:4, from /Users/robwills/.platformio/packages/framework-arduinoteensy/libraries/Robot_Control/src/ArduinoRobot.h:6, from /Users/robwills/.platformio/packages/framework-arduinoteensy/libraries/Robot_Control/src/ArduinoRobot.cpp:1: /Users/robwills/.platformio/packages/framework-arduinoteensy/libraries/Robot_Control/src/SdCard.h:76:2: error: #error unknown CPU #error unknown CPU ^
I’ve had a quick look through the headers that Adafruit_ST7735.h
and Adafruit_GFX.h
want, and no chain of #include
results in SdCard.h
.
So, two questions really…
- Why pull in
SdCard.h
for the build?
I noticed that an example in that “TFT” library is trying to pull in the SD library. Maybe the examples are not being excluded during the source discovery phase?
- Why would a header living in
/framework-arduinoteensy/libraries/
fail to compile?
Is it fair to expect any libraries that are “includable” from the framework should have all the necessary CPU defines etc, to build successfully?