Teensy 4.0 not compiling on Raspberry pi, bits/c++config.h: No such file or directory

Hello!

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 ========================================================

I appreciate any help I can get! Thank you!!

Maybe it’s a corrupt toolchain or framework. Remove the folders

and

To make PIO redownload the toolchain on the next compilation. Make sure to have enough free space.

1 Like

Thanks for the response! Unfortunately, no luck:

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 =================================================================

You’re right, that’s actually a known open issue per Error compiling Arduino board "teensy40" on Raspbian GNU/Linux 10 (buster) · Issue #51 · platformio/platform-teensy · GitHub. The arm-none-eabi toolchain that PlatformIO uses is outdated and they can’t seem to find or package a new version of it, as the last comment a while ago said…

Could you try adding the following into the platformio.ini of the project

platform_packages = 
   toolchain-gccarmnoneeabi@https://bintray.com/platformio/dl-packages/download_file?file_path=toolchain-gccarmnoneeabi-linux_armv6l-1.90301.200702.tar.gz

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.

Huh, well the error changed! I can’t quite tell if that is a problem solved? This is the new error


**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.90301.200702 (9.3.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

Compiling .pio/build/teensy40/FrameworkArduino/EventResponder.cpp.o

Compiling .pio/build/teensy40/FrameworkArduino/HardwareSerial.cpp.o

Compiling .pio/build/teensy40/FrameworkArduino/HardwareSerial1.cpp.o

Compiling .pio/build/teensy40/FrameworkArduino/HardwareSerial2.cpp.o

Compiling .pio/build/teensy40/FrameworkArduino/HardwareSerial3.cpp.o

Compiling .pio/build/teensy40/FrameworkArduino/HardwareSerial4.cpp.o

Compiling .pio/build/teensy40/FrameworkArduino/HardwareSerial5.cpp.o

Compiling .pio/build/teensy40/FrameworkArduino/HardwareSerial6.cpp.o

Compiling .pio/build/teensy40/FrameworkArduino/HardwareSerial7.cpp.o

Compiling .pio/build/teensy40/FrameworkArduino/HardwareSerial8.cpp.o

Compiling .pio/build/teensy40/FrameworkArduino/IPAddress.cpp.o

Compiling .pio/build/teensy40/FrameworkArduino/IntervalTimer.cpp.o

Compiling .pio/build/teensy40/FrameworkArduino/Print.cpp.o

Compiling .pio/build/teensy40/FrameworkArduino/Stream.cpp.o

Compiling .pio/build/teensy40/FrameworkArduino/Tone.cpp.o

Compiling .pio/build/teensy40/FrameworkArduino/WMath.cpp.o

Compiling .pio/build/teensy40/FrameworkArduino/WString.cpp.o

Compiling .pio/build/teensy40/FrameworkArduino/analog.c.o

Compiling .pio/build/teensy40/FrameworkArduino/bootdata.c.o

Compiling .pio/build/teensy40/FrameworkArduino/clockspeed.c.o

Compiling .pio/build/teensy40/FrameworkArduino/debugprintf.c.o

Compiling .pio/build/teensy40/FrameworkArduino/delay.c.o

Compiling .pio/build/teensy40/FrameworkArduino/digital.c.o

Compiling .pio/build/teensy40/FrameworkArduino/eeprom.c.o

Compiling .pio/build/teensy40/FrameworkArduino/interrupt.c.o

Compiling .pio/build/teensy40/FrameworkArduino/keylayouts.c.o

Compiling .pio/build/teensy40/FrameworkArduino/main.cpp.o

Compiling .pio/build/teensy40/FrameworkArduino/memcpy-armv7m.S.o

Compiling .pio/build/teensy40/FrameworkArduino/memset.S.o

Compiling .pio/build/teensy40/FrameworkArduino/new.cpp.o

Compiling .pio/build/teensy40/FrameworkArduino/nonstd.c.o

Compiling .pio/build/teensy40/FrameworkArduino/pwm.c.o

Compiling .pio/build/teensy40/FrameworkArduino/rtc.c.o

Compiling .pio/build/teensy40/FrameworkArduino/serialEvent.cpp.o

Compiling .pio/build/teensy40/FrameworkArduino/serialEvent1.cpp.o

Compiling .pio/build/teensy40/FrameworkArduino/serialEvent2.cpp.o

Compiling .pio/build/teensy40/FrameworkArduino/serialEvent3.cpp.o

Compiling .pio/build/teensy40/FrameworkArduino/serialEvent4.cpp.o

Compiling .pio/build/teensy40/FrameworkArduino/serialEvent5.cpp.o

Compiling .pio/build/teensy40/FrameworkArduino/serialEvent6.cpp.o

Compiling .pio/build/teensy40/FrameworkArduino/serialEvent7.cpp.o

Compiling .pio/build/teensy40/FrameworkArduino/serialEvent8.cpp.o

Compiling .pio/build/teensy40/FrameworkArduino/serialEventUSB1.cpp.o

Compiling .pio/build/teensy40/FrameworkArduino/serialEventUSB2.cpp.o

Compiling .pio/build/teensy40/FrameworkArduino/startup.c.o

Compiling .pio/build/teensy40/FrameworkArduino/tempmon.c.o

Compiling .pio/build/teensy40/FrameworkArduino/usb.c.o

Compiling .pio/build/teensy40/FrameworkArduino/usb_audio.cpp.o

Compiling .pio/build/teensy40/FrameworkArduino/usb_desc.c.o

Compiling .pio/build/teensy40/FrameworkArduino/usb_flightsim.cpp.o

Compiling .pio/build/teensy40/FrameworkArduino/usb_inst.cpp.o

Compiling .pio/build/teensy40/FrameworkArduino/usb_joystick.c.o

Compiling .pio/build/teensy40/FrameworkArduino/usb_keyboard.c.o

Compiling .pio/build/teensy40/FrameworkArduino/usb_midi.c.o

Compiling .pio/build/teensy40/FrameworkArduino/usb_mouse.c.o

Compiling .pio/build/teensy40/FrameworkArduino/usb_rawhid.c.o

Compiling .pio/build/teensy40/FrameworkArduino/usb_seremu.c.o

Compiling .pio/build/teensy40/FrameworkArduino/usb_serial.c.o

Compiling .pio/build/teensy40/FrameworkArduino/usb_serial2.c.o

Compiling .pio/build/teensy40/FrameworkArduino/usb_serial3.c.o

Compiling .pio/build/teensy40/FrameworkArduino/usb_touch.c.o

Compiling .pio/build/teensy40/FrameworkArduino/yield.cpp.o

Archiving .pio/build/teensy40/libFrameworkArduino.a

Indexing .pio/build/teensy40/libFrameworkArduino.a

Linking .pio/build/teensy40/firmware.elf

/home/pi/.platformio/packages/toolchain-gccarmnoneeabi@src-f2672645aa87274590eadcfd21f3d135/bin/../lib/gcc/arm-none-eabi/9.3.1/../../../../arm-none-eabi/bin/ld: cannot find -larm_cortexM7lfsp_math

collect2: error: ld returned 1 exit status

*** [.pio/build/teensy40/firmware.elf] Error 1

================================================================= [ **FAILED** ] Took 11.75 seconds =================================================================

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.

1 Like

Yes this indeed exists on the 5.4.1 compiler for my Windows system

I’ve uploaded the file at libarm_cortexM7lfsp_math.a - Google Drive.

Try copying it to /home/pi/.platformio/packages/toolchain-gccarmnoneeabi@src-f2672645aa87274590eadcfd21f3d135/arm-none-eabi/lib and retry compilation.

It’s so beautiful

Thank you!!!

My friend from the Emsland in Niedersachsen taught me how to say your name, and says hello!

**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.90301.200702 (9.3.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

Linking .pio/build/teensy40/firmware.elf

Building .pio/build/teensy40/firmware.hex

Checking size .pio/build/teensy40/firmware.elf

Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"

RAM: [= ] 7.9% (used 41660 bytes from 524288 bytes)

Flash: [ ] 0.6% (used 12960 bytes from 2031616 bytes)

===================================== [ **SUCCESS** ] Took 3.23 seconds =====================================

**pi@raspberrypi** : **~/Documents/Teensy40_Test $**

Wait! Damn, when I tried to upload it says:

**pi@raspberrypi** : **~/Documents/Teensy40_Test $** pio run --target upload

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)

- tool-teensy 1.21.1

- 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 90 compatible libraries

Scanning dependencies...

No dependencies

Building in release mode

Linking .pio/build/teensy40/firmware.elf

Building .pio/build/teensy40/firmware.hex

Checking size .pio/build/teensy40/firmware.elf

Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"

RAM: [= ] 7.9% (used 41660 bytes from 524288 bytes)

Flash: [ ] 0.6% (used 12960 bytes from 2031616 bytes)

Configuring upload protocol...

AVAILABLE: jlink, teensy-cli, teensy-gui

CURRENT: upload_protocol = teensy-cli

Rebooting...

Uploading .pio/build/teensy40/firmware.hex

Supported MCUs are:

Unknown MCU type "imxrt1062"

- at90usb162

- atmega32u4

*** [upload] Error 1

- at90usb646

- at90usb1286

- mkl26z64

- mk20dx128

- mk20dx256

- mk66fx1m0

- mk64fx512

- TEENSY2

- TEENSY2PP

- TEENSYLC

- TEENSY30

- TEENSY31

- TEENSY35

- TEENSY36

===================================== [ **FAILED** ] Took 3.30 seconds =====================================

**pi@raspberrypi** : **~/Documents/Teensy40_Test $**

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.

1 Like

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.

1 Like

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.

1 Like

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.

So, I finally set up my Pi, installed Arduino IDE, TeensyArduino, PlatformIO, compiled GitHub - PaulStoffregen/teensy_loader_cli: Command line Teensy Loader from source and created GitHub - maxgerhardt/pio-tool-teensy-arm which should have working binaries.

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

[env:teensy40]
platform = teensy
framework = arduino
board = teensy40 
platform_packages = 
   toolchain-gccarmnoneeabi@https://bintray.com/platformio/dl-packages/download_file?file_path=toolchain-gccarmnoneeabi-linux_armv6l-1.90301.200702.tar.gz
   tool-teensy@https://github.com/maxgerhardt/pio-tool-teensy-arm/archive/master.zip

On my Pi 3, together with the fix for the missing libarm_cortexM7lfsp_math.a , a pio run -t upload -v of the arduino-blink project (platform-teensy/examples/arduino-blink at develop · platformio/platform-teensy · GitHub) now leads to a correct invocation of the binary. I have no Teensy connected though

AVAILABLE: jlink, teensy-cli, teensy-gui
CURRENT: upload_protocol = teensy-cli
teensy_reboot -s
teensy_loader_cli -mmcu=imxrt1062 -w -s -v .pio/build/teensy40/firmware.hex
Teensy Loader, Command Line, Version 2.1
Read ".pio/build/teensy40/firmware.hex": 12932 bytes, 0.6% usage
Error opening USB device: No error
Waiting for Teensy device...
 (hint: press the reset button)

Let me know if works for you.

1 Like

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!

Yeah, looking at GitHub - PaulStoffregen/OctoWS2811: Control thousands of WS2811/2812 LEDs at video refresh speeds the error is pretty clear here, the library code was updated 6 months ago but the author failed to increment the library.json so we’re still getting a really old version from the PIO library repository.

This is fixed by explicitly pointing to the bleeding edge git version: Add

lib_deps = 
   OctoWS2811=https://github.com/PaulStoffregen/OctoWS2811.git

to the platformio.ini. If I then download OctoWS2811/examples/Teensy4_PinList/Teensy4_PinList.ino at master · PaulStoffregen/OctoWS2811 · GitHub as src\main.ino in the blinky project, it compiles.

LDF Modes: Finder ~ chain, Compatibility ~ soft
LibraryManager: Installing OctoWS2811
git version 2.20.1
Cloning into '/home/pi/arduino-blink/.pio/libdeps/teensy40/_tmp_installing-z6_r3b7x-package'...
OctoWS2811 @ aa374fc has been successfully installed!
Found 90 compatible libraries
Scanning dependencies...
Dependency Graph
|-- <OctoWS2811> 1.4 #aa374fc
Building in release mode
Compiling .pio/build/teensy40/src/Blink.ino.cpp.o
[...]
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
RAM:   [=         ]   8.7% (used 45788 bytes from 524288 bytes)
Flash: [          ]   0.8% (used 16848 bytes from 2031616 bytes)
======================== [SUCCESS] Took 43.03 seconds ========================

1 Like

Amazing! Thank you! Out with the dog but will try that soon. Thanks!

1 Like

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!

Spencer
NU3R

1 Like

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

As per comment in

That should be the right new path. Can you try with the platformio.ini and report errors?

[env:teensy40]
platform = teensy
framework = arduino
board = teensy40 
platform_packages = 
   toolchain-gccarmnoneeabi@https://bintray.com/platformio/tool-packages/download_file?file_path=3579c14-toolchain-gccarmnoneeabi-linux_armv6l-1.90301.200702.tar.gz
   tool-teensy@https://github.com/maxgerhardt/pio-tool-teensy-arm/archive/master.zip