New ARM toolchain for Teensy 3.0

Status
Not open for further replies.

PaulStoffregen

Well-known member
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.
 
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
 
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
 
Seems to work for me.

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

- Peter
 
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?
 
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
 
Status
Not open for further replies.
Back
Top