Forum Rule: Always post complete source code & details to reproduce any issue!
-
Toolchain for teensy 3.6
Good morning,
for my PhD I’ve written a c++ library in order to simulate electric circuits. The goal is to use this library on arm platforms too, such as RPi (yet accomplished) but not yet for teensy with a really small and simplified example.
Does an up-to-date version of toolchain exist? I’ve found a git repository but it is several years old.
To compile it on my RPi I’ve used the compiler Linaro for arm-Linux-gnuabihf (https://releases.linaro.org/componen...nux-gnueabihf/), cmake for creating the project (with the toolchain) and Qt as IDE. Could it be possible doing the same for the teensy?
Thanks
Borja
-
Senior Member+
You have it already, if you ever wrote a program for Teensy 
It is in arduino/hardware/tools/arm
-
And it is actually arm-none-eabi toolchain, which is the freestanding (not under any OS) version; arm-gnuabi is the soft-floating-point ARM under an OS with GNU C library, and arm-gnuabihf is for ARM with hardware floating point support used under an OS with GNU C library.
-
Senior Member
You can get a newer toolchain here.
https://developer.arm.com/tools-and-...u-rm/downloads
However, ARM website does not provide binary downloads for any ARM-based Linux platforms, like Raspberry Pi. You will need to build it from source. You'd think ARM would be more interested in promoting use of ARM-based Linux, but they only build ready-to-use toolchains for X86 platforms.
These newer toolchains may have minor compatibility issues with some of the code published for Teensy. If you want things to "just work", I do not recommend using a newer or different toolchain than the one we provide with Teensyduino. Likewise, we use C++14 dialect for C++ compiling. Others have not been tested and may have compatibility issues.
Only a few months ago, some Coremark speed comparisons were done between the older toolchain we currently have in Teensyduino and the latest (at the time) available from that download page. The speed of compiled code with -O3 (fastest) optimization was similar but slightly slower in the (then) latest version. If you will be using the well supported C++14 dialect, there is little reason to switch to the newer toolchains.
-
Hello,
Thank you for the answers.
I think there was a misunderstanding when I wrote toolchain. What I meant was “cmake toolchain” in the same way I used it for pc or rpi.
Anyway I’ll take a look at your responses and try to compile a reduced project with several .hpp and .cpp. This is very important, because it’s not really doable pasting the complete code in a single file.
By the way I’ve already downloaded the Linaro arm-none-eabi dist, however I needed a cmake toolchain ir order to create a simple project and compile it on Qt managing without Arduino ide.
Thanks
Borja
-
Senior Member+
If you can't compile it with teensyduino, it's not very compatible...
Why don't you make a library form it? This way everybody can use it easyly.
Apart from that: of course can Arduino use several .h and .cpp files..
-
Senior Member
This is the cmake toolchain I use for Teensy based projects:
Code:
set(CMAKE_SYSTEM_NAME Generic)
set(CMAKE_SYSTEM_PROCESSOR arm)
set(CMAKE_C_COMPILER arm-none-eabi-gcc)
set(CMAKE_CXX_COMPILER arm-none-eabi-g++)
set(CMAKE_OBJCOPY arm-none-eabi-objcopy)
set(CMAKE_SIZE arm-none-eabi-size)
set(CMAKE_C_COMPILER_ID GNU)
set(CMAKE_CXX_COMPILER_ID GNU)
set(CMAKE_C_COMPILER_FORCED TRUE)
set(CMAKE_CXX_COMPILER_FORCED TRUE)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules