I’m trying to compile a Teensy 3.6 project (Arduino framework) with platformio on an ARM platform running Ubuntu.
It’s a Nvidia Jetson TX2 (Armv8-A). It can’t find cc1plus when compiling.
Processing teensy36 (platform: teensy; board: teensy36; framework: arduino)
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
arm-none-eabi-g++ -o "/home/willem/catkin_ws/src/jros_robot/micro/basemc/src/basemc.ino.cpp" -x c++ -fpreprocessed -dD -E "/tmp/tmpvNTUGF"
arm-none-eabi-g++: error trying to exec 'cc1plus': execvp: No such file or directory
*** Error 1
I’ve tried to use Teensyduino, I didn’t get it to work but I did learn more about the problem.
To use Teensyduino I need the Arduino software which I didn’t get to work (because of a Java issue I think).
So I did some further digging and I think I know the cause of the problem. The PlatformIO toolchain (toolchain-gccarmnoneeabi) seems to be 32 bit while my platform is 64 bit ARM.
When I try to just run the compiler I get the message that the file cannot be found, which happens if you try to run an 32 bit binary on a 64 bit system:
$ ~/.platformio/packages/toolchain-gccarmnoneeabi/bin/arm-none-eabi-g++
-bash: /home/willem/.platformio/packages/toolchain-gccarmnoneeabi/bin/arm-none-eabi-g++: No such file or directory
$ file ~/.platformio/packages/toolchain-gccarmnoneeabi/bin/arm-none-eabi-g++
/home/willem/.platformio/packages/toolchain-gccarmnoneeabi/bin/arm-none-eabi-g++: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-armhf.so.3, for GNU/Linux 2.6.32, BuildID[sha1]=3fe0d6010e87afa9fefb1b148f647a1a6f066eb7, stripped
$ uname -i
aarch64
So to solve this an ARM 64 bit PlatformIO toolchain-gccarmnoneeabi which produces 32 bit binaries for the Teensy would be needed right? How can this be solved?
(note: I also tried with remote agent so that compile is not done on the ARM system, this however fails because of the same reason. pioplus can’t be executed because it is a 32 bit executable)
@ivankravets thanks for your quick response. I assume you refer to the Linux Installer (ARM / Raspberry Pi) on that page.
The download (TeensyduinoInstall.linuxarm) seems to be a self-extracting executable. Unfortunately this is also a 32 bit executable so it can’t be used on a 64bit ARM Ubuntu.
Apparently the system provided 64bit tools can create 32bot binaries for the Teensy.
What I did was from the PlatformIO toolchain remove the binaries, ie:
Then I can compile and upload to the Teensy. It would be nice this could be done without hacking the platform toolchain of course. Also in the future I would prefer to be able to use the remote agent.