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

Thread: New ARM toolchain for Teensy 3.0

  1. #1
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    20,171

    New ARM toolchain for Teensy 3.0

    I've been working to build a newer ARM toolchain, based on gcc 4.7.2. Currently we're using 4.4.1. My hope is to start using 4.7.2 in beta #11.

    Here are the latest files.

    Linux, 64 bit
    Mac OS-X
    Windows
    Source Code

    To try these, replace the "arm-none-eabi" folder within Arduino. On Linux and Windows, it's in hardware/tools. On Mac, control-click on Arduino, choose "show package contents", and look in Contents/Resources/Java/hardware/tools.

    If you try any of these, please reply to this topic. Did they work? Can you find any program/sketch/library that fails, but works on the old version?

    The linux version has been discussed here.

  2. #2
    Senior Member
    Join Date
    Nov 2012
    Posts
    1,108
    Hi Paul,
    On Win7, the behaviour of the serial port seems to have changed. In vanilla beta 10, this code will wait until the serial monitor is started before printing to the display.
    Code:
    void setup(void)
    {
      
      Serial.begin(9600);
      while(!Serial);
      delay(2000);
      Serial.println("Hello World");
    }
    
    void loop(void)
    {
    }
    But with the new toolchain it doesn't print anything. It also doesn't work if I change it to use Serial3.

    Pete

  3. #3
    Paul,

    I tried a couple of my simple programs and they work.

    Out of curiosity, are you using newlib or glibc or ...? I've been using newlib with gcc 4.8 but maybe there's downsides to that (like I'm noticing implementations of syscalls like _read that are probably not worth taking up space in my binary).

    I'm really psyched that you're upgrading. I'm sure this was a lot of work. I'm particularly interested in using C++ lambdas for event handlers.

    Thanks!

    -c

  4. #4
    Member
    Join Date
    Dec 2012
    Location
    Adelaide, SA
    Posts
    70
    Seems to work for me.

    Generates slightly smaller, and slightly slower, code. Not much though, slows down my SPI test by maybe 3%.

    - Peter

  5. #5
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    20,171
    Quote Originally Posted by el_supremo View Post
    But with the new toolchain it doesn't print anything.
    Thanks for reporting this!

    I was able to reproduce the problem. After some investigation, I discovered one of the variables in usb_serial.c that should have been "volatile" wasn't. My mistake! Using the older compiler, it doesn't matter. But the new compiler apparently can optimize more. It was optimizing away repetitively checking the handshaking variable, because it wasn't volatile.

    It also doesn't work if I change it to use Serial3.
    I tested Serial3 and it seems to work. Serial3 is hardware serial, so it doesn't have this boolean check to see if the other side is connected.

    Could you post a test program that reproduces the problem?

  6. #6
    Senior Member
    Join Date
    Nov 2012
    Posts
    1,108
    Hi Paul,
    Sorry, I forgot that Serial3 doesn't work the same way as Serial. There is still the known problem that an uploaded sketch is already running before the Serial Manager is started but that's not caused by the new toolchain.
    FYI: I've been playing with DSP instructions using a 128 tap FIR filter and with the new toolchain my test program runs about 3% faster.

    Pete

  7. #7
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    20,171
    I'm going publish beta 11 with the new toolchain and minimal changes (perhaps only the !Serial fix).

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •