Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 7 of 7

Thread: Toolchain for teensy 3.6

  1. #1
    Member
    Join Date
    Feb 2017
    Location
    A CoruŮa, Spain
    Posts
    28

    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

  2. #2
    Senior Member+ Frank B's Avatar
    Join Date
    Apr 2014
    Location
    Germany NRW
    Posts
    5,679
    You have it already, if you ever wrote a program for Teensy
    It is in arduino/hardware/tools/arm

  3. #3
    Senior Member
    Join Date
    Feb 2015
    Location
    Finland
    Posts
    120
    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.

  4. #4
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    20,440
    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.

  5. #5
    Member
    Join Date
    Feb 2017
    Location
    A CoruŮa, Spain
    Posts
    28
    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

  6. #6
    Senior Member+ Frank B's Avatar
    Join Date
    Apr 2014
    Location
    Germany NRW
    Posts
    5,679
    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..

  7. #7
    Senior Member brtaylor's Avatar
    Join Date
    Mar 2016
    Location
    Portland, OR
    Posts
    533
    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
  •