For some reason I can’t compile code for the Teensy 4.0 on my raspberry pi. I am trying to use the raspberry pi to do over the air updates to my project using the Teensy 4.0, but while it works for all other teensy boards it won’t run for the teensy 4.0 or teensy 4.1. I installed PlatformIO a few days back and I have run Pio update to make sure everything is up to date, but I still get these errors when I try to compile:
pi@raspberrypi:~/Documents/Teensy40_Test $ pio run
Processing teensy40 (platform: teensy; board: teensy40; framework: arduino)
---------------------------------------------------------------------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/teensy/teensy40.html
PLATFORM: Teensy 4.11.0 > Teensy 4.0
HARDWARE: IMXRT1062 600MHz, 512KB RAM, 1.94MB Flash
DEBUG: Current (jlink) External (jlink)
PACKAGES:
- framework-arduinoteensy 1.153.0 (1.53)
- toolchain-gccarmnoneeabi 1.50401.0 (5.4.1)
LDF: Library Dependency Finder -> http://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 90 compatible libraries
Scanning dependencies...
No dependencies
Building in release mode
Compiling .pio/build/teensy40/src/main.cpp.o
Compiling .pio/build/teensy40/FrameworkArduino/AudioStream.cpp.o
Compiling .pio/build/teensy40/FrameworkArduino/Blink.cc.o
Compiling .pio/build/teensy40/FrameworkArduino/DMAChannel.cpp.o
In file included from /home/pi/.platformio/packages/framework-arduinoteensy/cores/teensy4/wiring.h:45:0,
from /home/pi/.platformio/packages/framework-arduinoteensy/cores/teensy4/WProgram.h:45,
from /home/pi/.platformio/packages/framework-arduinoteensy/cores/teensy4/Arduino.h:6,
from src/main.cpp:1:
/home/pi/.platformio/packages/toolchain-gccarmnoneeabi/arm-none-eabi/include/c++/5.4.1/type_traits:38:28: fatal error: bits/c++config.h: No such file or directory
compilation terminated.
*** [.pio/build/teensy40/src/main.cpp.o] Error 1
In file included from /home/pi/.platformio/packages/framework-arduinoteensy/cores/teensy4/wiring.h:45:0,
from /home/pi/.platformio/packages/framework-arduinoteensy/cores/teensy4/WProgram.h:45,
from /home/pi/.platformio/packages/framework-arduinoteensy/cores/teensy4/Arduino.h:6,
from /home/pi/.platformio/packages/framework-arduinoteensy/cores/teensy4/AudioStream.cpp:32:
/home/pi/.platformio/packages/toolchain-gccarmnoneeabi/arm-none-eabi/include/c++/5.4.1/type_traits:38:28: fatal error: bits/c++config.h: No such file or directory
compilation terminated.
*** [.pio/build/teensy40/FrameworkArduino/AudioStream.cpp.o] Error 1
In file included from /home/pi/.platformio/packages/framework-arduinoteensy/cores/teensy4/wiring.h:45:0,
from /home/pi/.platformio/packages/framework-arduinoteensy/cores/teensy4/WProgram.h:45,
from /home/pi/.platformio/packages/framework-arduinoteensy/cores/teensy4/Arduino.h:6,
from /home/pi/.platformio/packages/framework-arduinoteensy/cores/teensy4/Blink.cc:3:
/home/pi/.platformio/packages/toolchain-gccarmnoneeabi/arm-none-eabi/include/c++/5.4.1/type_traits:38:28: fatal error: bits/c++config.h: No such file or directory
compilation terminated.
*** [.pio/build/teensy40/FrameworkArduino/Blink.cc.o] Error 1
======================================================== [FAILED] Took 2.83 seconds ========================================================
pi@raspberrypi:~/.platformio/packages $ rm -rf framework-arduinoteensy
pi@raspberrypi:~/.platformio/packages $ rm -rf toolchain-gccarmnoneeabi/
pi@raspberrypi:~/.platformio/packages $ cd
pi@raspberrypi:~ $ cd Documents/Visualisd/
pi@raspberrypi:~/Documents/Visualisd $ vim platformio.ini
pi@raspberrypi:~/Documents/Visualisd $ pio run
Processing teensy40 (platform: teensy; board: teensy40; framework: arduino)
------------------------------------------------------------------------
PackageManager: Installing framework-arduinoteensy @ ~1.153.0
Downloading [####################################] 100%
Unpacking [####################################] 100%
framework-arduinoteensy @ 1.153.0 has been successfully installed!
PackageManager: Installing toolchain-gccarmnoneeabi @ ~1.50401.0
Downloading [####################################] 100%
Unpacking [####################################] 100%
toolchain-gccarmnoneeabi @ 1.50401.0 has been successfully installed!
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/teensy/teensy40.html
PLATFORM: Teensy 4.11.0 > Teensy 4.0
HARDWARE: IMXRT1062 600MHz, 512KB RAM, 1.94MB Flash
DEBUG: Current (jlink) External (jlink)
PACKAGES:
- framework-arduinoteensy 1.153.0 (1.53)
- toolchain-gccarmnoneeabi 1.50401.0 (5.4.1)
LDF: Library Dependency Finder -> http://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 91 compatible libraries
Scanning dependencies...
Dependency Graph
|-- <OctoWS2811> 1.4
|-- <arduinoFFT> 1.5.5
Building in release mode
Compiling .pio/build/teensy40/src/main.cpp.o
Compiling .pio/build/teensy40/lib476/OctoWS2811/OctoWS2811.cpp.o
Compiling .pio/build/teensy40/lib7d0/arduinoFFT/arduinoFFT.cpp.o
In file included from /home/pi/.platformio/packages/framework-arduinoteensy/cores/teensy4/wiring.h:45:0,
from /home/pi/.platformio/packages/framework-arduinoteensy/cores/teensy4/WProgram.h:45,
from /home/pi/.platformio/packages/framework-arduinoteensy/cores/teensy4/Arduino.h:6,
from src/main.cpp:1:
/home/pi/.platformio/packages/toolchain-gccarmnoneeabi/arm-none-eabi/include/c++/5.4.1/type_traits:38:28: fatal error: bits/c++config.h: No such file or directory
compilation terminated.
Compiling .pio/build/teensy40/FrameworkArduino/AudioStream.cpp.o
*** [.pio/build/teensy40/src/main.cpp.o] Error 1
In file included from /home/pi/.platformio/packages/framework-arduinoteensy/cores/teensy4/wiring.h:45:0,
from /home/pi/.platformio/packages/framework-arduinoteensy/cores/teensy4/WProgram.h:45,
from /home/pi/.platformio/packages/framework-arduinoteensy/cores/teensy4/Arduino.h:6,
from .pio/libdeps/teensy40/OctoWS2811/OctoWS2811.h:27,
from .pio/libdeps/teensy40/OctoWS2811/OctoWS2811.cpp:27:
/home/pi/.platformio/packages/toolchain-gccarmnoneeabi/arm-none-eabi/include/c++/5.4.1/type_traits:38:28: fatal error: bits/c++config.h: No such file or directory
compilation terminated.
*** [.pio/build/teensy40/lib476/OctoWS2811/OctoWS2811.cpp.o] Error 1
In file included from /home/pi/.platformio/packages/framework-arduinoteensy/cores/teensy4/wiring.h:45:0,
from /home/pi/.platformio/packages/framework-arduinoteensy/cores/teensy4/WProgram.h:45,
from /home/pi/.platformio/packages/framework-arduinoteensy/cores/teensy4/Arduino.h:6,
from /home/pi/.platformio/lib/arduinoFFT/src/arduinoFFT.h:26,
from /home/pi/.platformio/lib/arduinoFFT/src/arduinoFFT.cpp:22:
/home/pi/.platformio/packages/toolchain-gccarmnoneeabi/arm-none-eabi/include/c++/5.4.1/type_traits:38:28: fatal error: bits/c++config.h: No such file or directory
compilation terminated.
*** [.pio/build/teensy40/lib7d0/arduinoFFT/arduinoFFT.cpp.o] Error 1
In file included from /home/pi/.platformio/packages/framework-arduinoteensy/cores/teensy4/wiring.h:45:0,
from /home/pi/.platformio/packages/framework-arduinoteensy/cores/teensy4/WProgram.h:45,
from /home/pi/.platformio/packages/framework-arduinoteensy/cores/teensy4/Arduino.h:6,
from /home/pi/.platformio/packages/framework-arduinoteensy/cores/teensy4/AudioStream.cpp:32:
/home/pi/.platformio/packages/toolchain-gccarmnoneeabi/arm-none-eabi/include/c++/5.4.1/type_traits:38:28: fatal error: bits/c++config.h: No such file or directory
compilation terminated.
*** [.pio/build/teensy40/FrameworkArduino/AudioStream.cpp.o] Error 1
================================================================= [FAILED] Took 34.90 seconds =================================================================
Or if using a 64-bit ARM OS then https://bintray.com/platformio/dl-packages/download_file?file_path=toolchain-gccarmnoneeabi-linux_aarch64-1.90301.200702.tar.gz as the download link. This might download a more recent raspberry-compatible toolchain for ARM. (docs)
Otherwise, you might have luck downloading the uploaded toolchain, or the one downloaded by the Arduino IDE and teensy package, and replacing the toolchain files within /home/pi/.platformio/packages/toolchain-gccarmnoneeabi/ with the same folder structure.
Hmm compilation now goes through much further, indiciating that generally the compiler is runnable, but the compiler seems to be lacking the floating point math library for the Cortex-M7 of that target chip. Let me se whether I can find libarm_cortexM7lfsp_math.a in the supposedly correct compiler.
Yet another case of a non-updated teensy-cli package version. It only goes up to TEENSY36. Alright, let’s figure this one out, too… The package in question here is ~/.platformio/packages/tool-teensy containing outdated binaries. Let me check.
Hm, the available packages at Service End for Bintray, JCenter, GoCenter, and ChartCenter | JFrog are hopelessly outdated, for Windows it goes up to tool-teensy-windows-1.152.200516.tar.gz (3 months ago), for ARMv6l up to tool-teensy-linux_armv6l-1.21.1.tar.gz (2 years ago). Let me check where the Arduino-Teensy core gets these binaries from.
I found the binaries at Teensyduino: Download and Install Teensy support into the Arduino IDE and I’m extracting them on my raspberry pi (they just had to put the important files into a ELF executable which only executable on ARM…) and create a new update package for it which will be includable via platform_packages.
Note that you need the udev rules installed as the download page says, so if you don’t, install these and reboot the pi.
If you know, did I do something wrong in my install? Why am I having so many issues? This is a fresh install for my Pi 4 and I followed the tutorial for installation. Is this just not something many people have done? Or did I do something wrong with my setup?
Your Pi installation is probably perfectly fine, these are issues in PlatformIO related to using it on ARM; toolchain update has been standing out long.
To use them, you need to override the tool-teensy package with a new line in platform_packages. Edit your platformio.ini so that it looks something like this
Hey! That worked perfectly! My blank program now uploads! My other program is still having trouble but I think that is for other reasons to do with the OctoWS2811 library on the Teensy 4.0 and PlatformIO. I’ll post the errors here, but you have already helped so much, so only take a look if you’re willing! Thank you for all the help!
Here is the new error if you are curious:
pi@raspberrypi:~/Documents/Visualisd $ pio run --target upload
Processing teensy40 (platform: teensy; framework: arduino; board: teensy40)
-----------------------------------------------------------------------------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/teensy/teensy40.html
PLATFORM: Teensy 4.11.0 > Teensy 4.0
HARDWARE: IMXRT1062 600MHz, 512KB RAM, 1.94MB Flash
DEBUG: Current (jlink) External (jlink)
PACKAGES:
- framework-arduinoteensy 1.153.0 (1.53)
- tool-teensy 1.152.200516 (1.52)
- toolchain-gccarmnoneeabi 1.90301.200702 (9.3.1)
LDF: Library Dependency Finder -> http://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 91 compatible libraries
Scanning dependencies...
Dependency Graph
|-- <OctoWS2811> 1.4
|-- <arduinoFFT> 1.5.5
Building in release mode
Compiling .pio/build/teensy40/src/main.cpp.o
Compiling .pio/build/teensy40/lib476/OctoWS2811/OctoWS2811.cpp.o
Compiling .pio/build/teensy40/lib7d0/arduinoFFT/arduinoFFT.cpp.o
Compiling .pio/build/teensy40/FrameworkArduino/AudioStream.cpp.o
/home/pi/.platformio/lib/arduinoFFT/src/arduinoFFT.cpp:26:3: warning: #warning ("This method is deprecated and may be removed on future revisions.") [-Wcpp]
26 | #warning("This method is deprecated and may be removed on future revisions.")
| ^~~~~~~
/home/pi/.platformio/lib/arduinoFFT/src/arduinoFFT.cpp:50:3: warning: #warning ("This method is deprecated and may be removed on future revisions.") [-Wcpp]
50 | #warning("This method is deprecated and may be removed on future revisions.")
| ^~~~~~~
/home/pi/.platformio/lib/arduinoFFT/src/arduinoFFT.cpp:121:3: warning: #warning ("This method is deprecated and may be removed on future revisions.") [-Wcpp]
121 | #warning("This method is deprecated and may be removed on future revisions.")
| ^~~~~~~
/home/pi/.platformio/lib/arduinoFFT/src/arduinoFFT.cpp:192:3: warning: #warning ("This method is deprecated and may be removed on future revisions.") [-Wcpp]
192 | #warning("This method is deprecated and may be removed on future revisions.")
| ^~~~~~~
/home/pi/.platformio/lib/arduinoFFT/src/arduinoFFT.cpp:217:3: warning: #warning ("This method is deprecated and may be removed on future revisions.") [-Wcpp]
217 | #warning("This method is deprecated and may be removed on future revisions.")
| ^~~~~~~
/home/pi/.platformio/lib/arduinoFFT/src/arduinoFFT.cpp:287:3: warning: #warning ("This method is deprecated and may be removed on future revisions.") [-Wcpp]
287 | #warning("This method is deprecated and may be removed on future revisions.")
| ^~~~~~~
/home/pi/.platformio/lib/arduinoFFT/src/arduinoFFT.cpp:384:3: warning: #warning ("This method is deprecated and may be removed on future revisions.") [-Wcpp]
384 | #warning("This method is deprecated and may be removed on future revisions.")
| ^~~~~~~
/home/pi/.platformio/lib/arduinoFFT/src/arduinoFFT.cpp:407:3: warning: #warning ("This method is deprecated and may be removed on future revisions.") [-Wcpp]
407 | #warning("This method is deprecated and may be removed on future revisions.")
| ^~~~~~~
/home/pi/.platformio/lib/arduinoFFT/src/arduinoFFT.cpp:432:3: warning: #warning ("This method may not be accessible on future revisions.") [-Wcpp]
432 | #warning("This method may not be accessible on future revisions.")
| ^~~~~~~
.pio/libdeps/teensy40/OctoWS2811/OctoWS2811.cpp: In member function 'void OctoWS2811::begin()':
.pio/libdeps/teensy40/OctoWS2811/OctoWS2811.cpp:85:2: error: 'GPIOD_PCOR' was not declared in this scope; did you mean 'GPIO5_PSR'?
85 | GPIOD_PCOR = 0xFF;
| ^~~~~~~~~~
| GPIO5_PSR
.pio/libdeps/teensy40/OctoWS2811/OctoWS2811.cpp:168:19: error: 'GPIOD_PSOR' was not declared in this scope; did you mean 'GPIO5_PSR'?
168 | dma1.destination(GPIOD_PSOR);
| ^~~~~~~~~~
| GPIO5_PSR
.pio/libdeps/teensy40/OctoWS2811/OctoWS2811.cpp:175:19: error: 'GPIOD_PDOR' was not declared in this scope; did you mean 'GPIO6_GDIR'?
175 | dma2.destination(GPIOD_PDOR);
| ^~~~~~~~~~
| GPIO6_GDIR
*** [.pio/build/teensy40/lib476/OctoWS2811/OctoWS2811.cpp.o] Error 1
In file included from src/main.cpp:7:
src/visualQueue.h: In member function 'void visualQueue::userSkip(int)':
src/visualQueue.h:31:18: warning: comparison of integer expressions of different signedness: 'int' and 'std::queue<queueItem>::size_type' {aka 'unsigned int'} [-Wsign-compare]
31 | if(index > userQueue.size()) {
| ~~~~~~^~~~~~~~~~~~~~~~~~
src/visualQueue.h:33:30: warning: comparison of integer expressions of different signedness: 'int' and 'std::queue<queueItem>::size_type' {aka 'unsigned int'} [-Wsign-compare]
33 | for(int i = 0; i < userQueue.size(); i ++) {
| ~~^~~~~~~~~~~~~~~~~~
============================================================ [FAILED] Took 3.98 seconds ============================================================
Thank you for being so helpful! This community is really great!
That was perfect! Totally works now! Thank you so much! I’ll leave the solution as the one earlier because it more directly answers the original error, but thank you so much!
Hey @maxgerhardt ! Thank you for all your help a while back! Unfortunately this link you posted has now expired I think. Myself and others using this are now getting the error:
Error: Got the unrecognized status code '404' when downloaded https://bintray.com/platformio/dl-packages/download_file?file_path=toolchain-gccarmnoneeabi-linux_armv6l-1.90301.200702.tar.gz