Teensy 3.0 Beta12 Software

Status
Not open for further replies.
Given you are going from 4.4.x to 4.7.x, I could try either
  • -std=c++98 (or)
  • -std=gnu++98 (or)
  • -std=c++11 (or)
  • -std=gnu++11

To try other versions of the C++ standard. You might check out: http://gcc.gnu.org/gcc-4.7/changes.html

I've already tried all those parameters, to no avail.

I suspect some default parameter for size optimisation.

Here is the comparison between gcc 4.4.1 and gcc 4.7.2:

File Size in Bytesgcc 4.4.1gcc 4.7.2Difference
IPAddress.o1702013640-3380
main.o2267621848-828
HardwareSerial2.o2411223396-716
HardwareSerial3.o2411223396-716
HardwareSerial1.o1956819280-288
yield.o22242096-128
usb_desc.o43484272-76
usb_inst.o2144421372-72
keylayouts.o23522348-4
embeddedcomputing.eep13130
eeprom.o8332836836
serial2.o9864993672
serial3.o9864993672
touch.o44004516116
usb_joystick.o22162388172
usb_keyboard.o22162388172
usb_midi.o21882360172
usb_mouse.o22122388176
usb_seremu.o21922368176
LocalLibrary.o43164556240
usb_mem.o70967356260
analog.o85208908388
usb_serial.o1110811516408
nonstd.o48565320464
serial1.o1312813756628
mk20dx128.o1100411640636
WMath.o62966964668
usb_dev.o20872222961424
WString.o73856754961640
Print.o21180235922412
Stream.o28468310002532
pins_teensy.o27560315964036
[tr][td]embeddedcomputing.elf[/td][td]159114[/td][td]35863[/td][td]-123251[/td][/tr]
[tr][td]embeddedcomputing.hex[/td][td]17060[/td][td]3507[/td][td]-13553[/td][/tr]
[td]embeddedcomputing.a[/td][td]402714[/td][td]413554[/td][td]10840[/td]
 
Last edited:
HI all,

SOLVED ! :cool:
just expand arduino 1.0.3 in good directory : program filesx86
and enjoy
button next is active.
Regards,
Jacques
 
Update on the unexpected size of the hex with latest release of Teensyduino featuring gcc 4.7.2

Standard procedure, working on both 4.4.1 and 4.7.2
Code:
../tools/arm-none-eabi/bin/arm-none-eabi-gcc -mcpu=cortex-m4 -lm -Wl,--gc-sections -Os -Tmk20dx128.ld -mthumb -o embeddedcomputing.elf analog.o eeprom.o keylayouts.o mk20dx128.o nonstd.o pins_teensy.o serial1.o serial2.o serial3.o touch.o usb_desc.o usb_dev.o usb_joystick.o usb_keyboard.o usb_mem.o usb_midi.o usb_mouse.o usb_rawhid.o usb_seremu.o usb_serial.o yield.o HardwareSerial1.o HardwareSerial2.o HardwareSerial3.o IPAddress.o Print.o Stream.o WMath.o WString.o usb_flightsim.o usb_inst.o LocalLibrary.o main.o -lc -L.

Optimised procedure, with archive and then link, works on 4.4.1...
Code:
../tools/arm-none-eabi/bin/arm-none-eabi-ar vrcs embeddedcomputing.a analog.o eeprom.o keylayouts.o mk20dx128.o nonstd.o pins_teensy.o serial1.o serial2.o serial3.o touch.o usb_desc.o usb_dev.o usb_joystick.o usb_keyboard.o usb_mem.o usb_midi.o usb_mouse.o usb_rawhid.o usb_seremu.o usb_serial.o yield.o HardwareSerial1.o HardwareSerial2.o HardwareSerial3.o IPAddress.o Print.o Stream.o WMath.o WString.o usb_flightsim.o usb_inst.o

Code:
../tools/arm-none-eabi/bin/arm-none-eabi-gcc -mcpu=cortex-m4 -lm -Wl,--gc-sections,-verbose  -Os -Tmk20dx128.ld -mthumb -o embeddedcomputing.elf embeddedcomputing.a LocalLibrary.o main.o -lc -L.

...but doesn't work on 4.7.2
Code:
../tools/arm-none-eabi/bin/arm-none-eabi-ar vrcs embeddedcomputing.a analog.o eeprom.o keylayouts.o mk20dx128.o nonstd.o pins_teensy.o serial1.o serial2.o serial3.o touch.o usb_desc.o usb_dev.o usb_joystick.o usb_keyboard.o usb_mem.o usb_midi.o usb_mouse.o usb_rawhid.o usb_seremu.o usb_serial.o yield.o HardwareSerial1.o HardwareSerial2.o HardwareSerial3.o IPAddress.o Print.o Stream.o WMath.o WString.o usb_flightsim.o usb_inst.o

Code:
../tools/arm-none-eabi/bin/arm-none-eabi-gcc -mcpu=cortex-m4 -lm -Wl,--gc-sections,-verbose  -Os -Tmk20dx128.ld -mthumb -o embeddedcomputing.elf embeddedcomputing.a LocalLibrary.o main.o -lc -L.

Any idea?
 
Not sure if this has been reported yet, but every so often I get a temporary directory not found, resulting in an "Error communicating with Teensy loader".

Code:
Feb  2 00:49:32 pauls-MacBook-Pro-2 [0x0-0x1c01c].com.pjrc.teensy[221]: remote connection opened
Feb  2 00:49:32 pauls-MacBook-Pro-2 [0x0-0x1c01c].com.pjrc.teensy[221]: remote cmd: "comment: Teensyduino 1.12-beta12 - MACOSX"
Feb  2 00:49:32 pauls-MacBook-Pro-2 [0x0-0x1c01c].com.pjrc.teensy[221]: file changed
Feb  2 00:49:32 pauls-MacBook-Pro-2 [0x0-0x1c01c].com.pjrc.teensy[221]: File "staff_mpu_fastspi_sd.cpp.hex". 24988 bytes, 19% used
Feb  2 00:49:32 pauls-MacBook-Pro-2 [0x0-0x321321].cc.arduino.Arduino.teensyduino[13303]: Teensy Loader could not find the directory /var/folders/p6/n8_p41b974qf8dzx7r_8nb2m0000gn/T/build5708963839413317469.tmp
Feb  2 00:49:32 pauls-MacBook-Pro-2 [0x0-0x1c01c].com.pjrc.teensy[221]: remote cmd: "dir:/var/folders/p6/n8_p41b974qf8dzx7r_8nb2m0000gn/T/build5708963839413317469.tmp/"
Feb  2 00:49:32 pauls-MacBook-Pro-2 [0x0-0x1c01c].com.pjrc.teensy[221]: remote cmd: "file:staff_mpu_fastspi_sd.cpp.hex"
Feb  2 00:49:32 pauls-MacBook-Pro-2 [0x0-0x1c01c].com.pjrc.teensy[221]: File "staff_mpu_fastspi_sd.cpp.hex". 24988 bytes, 19% used
Feb  2 00:49:32 pauls-MacBook-Pro-2 [0x0-0x1c01c].com.pjrc.teensy[221]: remote connection closed

I am not removing anything... When I hit apple-U again it usually resolves by itself. I think I had this in beta 10 as well, but only lately. Could be a problem on my Mac, but have no idea what could be causing it.
 
Not sure if this has been reported yet, but every so often I get a temporary directory not found, resulting in an "Error communicating with Teensy loader".

I don't think it is a problem on your Mac, I'm running Win7 x64 Home Premium edition and I have noticed this too.

It happened 3 maybe 4 times so far and when it happens, it appears to be after trying to compile a sketch the first time after opening teensyduino.
Because of that I assumed the compiler wasnt 'ready' yet, after retrying I don't get this error anymore.
Just tried to trigger it, but not happening within 15 restarts...
 
Last edited:
Same thing happening in 1.11, and it seems to be getting worse. Sometimes I have to repeat the compile shortcut many times before it "takes"

Code:
Feb  2 11:27:03 pauls-MacBook-Pro-2 [0x0-0x1c01c].com.pjrc.teensy[221]: remote connection opened
Feb  2 11:27:03 pauls-MacBook-Pro-2 [0x0-0x1c01c].com.pjrc.teensy[221]: remote cmd: "comment: Teensyduino 1.11 - MACOSX"
Feb  2 11:27:03 pauls-MacBook-Pro-2 [0x0-0x1c01c].com.pjrc.teensy[221]: file changed
Feb  2 11:27:03 pauls-MacBook-Pro-2 [0x0-0x1c01c].com.pjrc.teensy[221]: File "staff_mpu_fastspi_sd.cpp.hex". 26560 bytes, 20% used
Feb  2 11:27:03 pauls-MacBook-Pro-2 [0x0-0x33b33b].cc.arduino.Arduino.teensyduino[14676]: Teensy Loader could not find the directory /var/folders/p6/n8_p41b974qf8dzx7r_8nb2m0000gn/T/build8794368102834605621.tmp
Feb  2 11:27:03 pauls-MacBook-Pro-2 [0x0-0x1c01c].com.pjrc.teensy[221]: remote cmd: "dir:/var/folders/p6/n8_p41b974qf8dzx7r_8nb2m0000gn/T/build8794368102834605621.tmp/"
Feb  2 11:27:03 pauls-MacBook-Pro-2 [0x0-0x1c01c].com.pjrc.teensy[221]: remote cmd: "file:staff_mpu_fastspi_sd.cpp.hex"
Feb  2 11:27:03 pauls-MacBook-Pro-2 [0x0-0x1c01c].com.pjrc.teensy[221]: File "staff_mpu_fastspi_sd.cpp.hex". 26560 bytes, 20% used
Feb  2 11:27:03 pauls-MacBook-Pro-2 [0x0-0x1c01c].com.pjrc.teensy[221]: remote connection closed
Feb  2 11:29:28 pauls-MacBook-Pro-2 mDNSResponder[72]: Double NAT (external NAT gateway address 192.168.1.254 is also a private RFC 1918 address)
Feb  2 11:31:42 pauls-MacBook-Pro-2 [0x0-0x1c01c].com.pjrc.teensy[221]: remote connection opened
Feb  2 11:31:42 pauls-MacBook-Pro-2 [0x0-0x1c01c].com.pjrc.teensy[221]: file changed
Feb  2 11:31:42 pauls-MacBook-Pro-2 [0x0-0x1c01c].com.pjrc.teensy[221]: File "staff_mpu_fastspi_sd.cpp.hex". 26592 bytes, 20% used
Feb  2 11:31:42 pauls-MacBook-Pro-2 [0x0-0x33b33b].cc.arduino.Arduino.teensyduino[14676]: Teensy Loader error responding to comment
Feb  2 11:31:42 pauls-MacBook-Pro-2 [0x0-0x1c01c].com.pjrc.teensy[221]: remote cmd: "comment: Teensyduino 1.11 - MACOSX"
Feb  2 11:31:43 pauls-MacBook-Pro-2 [0x0-0x1c01c].com.pjrc.teensy[221]: remote connection closed
Feb  2 11:31:45 pauls-MacBook-Pro-2 [0x0-0x1c01c].com.pjrc.teensy[221]: remote connection opened
Feb  2 11:31:45 pauls-MacBook-Pro-2 [0x0-0x1c01c].com.pjrc.teensy[221]: remote cmd: "comment: Teensyduino 1.11 - MACOSX"
Feb  2 11:31:45 pauls-MacBook-Pro-2 [0x0-0x1c01c].com.pjrc.teensy[221]: file changed
Feb  2 11:31:45 pauls-MacBook-Pro-2 [0x0-0x1c01c].com.pjrc.teensy[221]: File "staff_mpu_fastspi_sd.cpp.hex". 26592 bytes, 20% used
Feb  2 11:31:45 pauls-MacBook-Pro-2 [0x0-0x33b33b].cc.arduino.Arduino.teensyduino[14676]: Teensy Loader could not find the directory /var/folders/p6/n8_p41b974qf8dzx7r_8nb2m0000gn/T/build8794368102834605621.tmp
Feb  2 11:31:45 pauls-MacBook-Pro-2 [0x0-0x1c01c].com.pjrc.teensy[221]: remote cmd: "dir:/var/folders/p6/n8_p41b974qf8dzx7r_8nb2m0000gn/T/build8794368102834605621.tmp/"
Feb  2 11:31:45 pauls-MacBook-Pro-2 [0x0-0x1c01c].com.pjrc.teensy[221]: remote cmd: "file:staff_mpu_fastspi_sd.cpp.hex"
Feb  2 11:31:45 pauls-MacBook-Pro-2 [0x0-0x1c01c].com.pjrc.teensy[221]: File "staff_mpu_fastspi_sd.cpp.hex". 26592 bytes, 20% used
Feb  2 11:31:45 pauls-MacBook-Pro-2 [0x0-0x1c01c].com.pjrc.teensy[221]: remote connection closed
Feb  2 11:31:47 pauls-MacBook-Pro-2 [0x0-0x1c01c].com.pjrc.teensy[221]: remote connection opened
Feb  2 11:31:47 pauls-MacBook-Pro-2 [0x0-0x1c01c].com.pjrc.teensy[221]: remote cmd: "comment: Teensyduino 1.11 - MACOSX"
Feb  2 11:31:47 pauls-MacBook-Pro-2 [0x0-0x1c01c].com.pjrc.teensy[221]: file changed
Feb  2 11:31:47 pauls-MacBook-Pro-2 [0x0-0x1c01c].com.pjrc.teensy[221]: File "staff_mpu_fastspi_sd.cpp.hex". 26592 bytes, 20% used
Feb  2 11:31:47 pauls-MacBook-Pro-2 [0x0-0x33b33b].cc.arduino.Arduino.teensyduino[14676]: Teensy Loader could not find the directory /var/folders/p6/n8_p41b974qf8dzx7r_8nb2m0000gn/T/build8794368102834605621.tmp
Feb  2 11:31:47 pauls-MacBook-Pro-2 [0x0-0x1c01c].com.pjrc.teensy[221]: remote cmd: "dir:/var/folders/p6/n8_p41b974qf8dzx7r_8nb2m0000gn/T/build8794368102834605621.tmp/"
Feb  2 11:31:47 pauls-MacBook-Pro-2 [0x0-0x1c01c].com.pjrc.teensy[221]: remote cmd: "file:staff_mpu_fastspi_sd.cpp.hex"
Feb  2 11:31:47 pauls-MacBook-Pro-2 [0x0-0x1c01c].com.pjrc.teensy[221]: File "staff_mpu_fastspi_sd.cpp.hex". 26592 bytes, 20% used
Feb  2 11:31:47 pauls-MacBook-Pro-2 [0x0-0x1c01c].com.pjrc.teensy[221]: remote connection closed
Feb  2 11:31:50 pauls-MacBook-Pro-2 [0x0-0x1c01c].com.pjrc.teensy[221]: remote connection opened
Feb  2 11:31:50 pauls-MacBook-Pro-2 [0x0-0x1c01c].com.pjrc.teensy[221]: remote cmd: "comment: Teensyduino 1.11 - MACOSX"
Feb  2 11:31:50 pauls-MacBook-Pro-2 [0x0-0x1c01c].com.pjrc.teensy[221]: file changed
Feb  2 11:31:50 pauls-MacBook-Pro-2 [0x0-0x1c01c].com.pjrc.teensy[221]: File "staff_mpu_fastspi_sd.cpp.hex". 26592 bytes, 20% used
Feb  2 11:31:50 pauls-MacBook-Pro-2 [0x0-0x33b33b].cc.arduino.Arduino.teensyduino[14676]: Teensy Loader could not find the directory /var/folders/p6/n8_p41b974qf8dzx7r_8nb2m0000gn/T/build8794368102834605621.tmp
Feb  2 11:31:50 pauls-MacBook-Pro-2 [0x0-0x1c01c].com.pjrc.teensy[221]: remote cmd: "dir:/var/folders/p6/n8_p41b974qf8dzx7r_8nb2m0000gn/T/build8794368102834605621.tmp/"
Feb  2 11:31:51 pauls-MacBook-Pro-2 [0x0-0x1c01c].com.pjrc.teensy[221]: remote cmd: "file:staff_mpu_fastspi_sd.cpp.hex"
Feb  2 11:31:51 pauls-MacBook-Pro-2 [0x0-0x1c01c].com.pjrc.teensy[221]: File "staff_mpu_fastspi_sd.cpp.hex". 26592 bytes, 20% used
Feb  2 11:31:51 pauls-MacBook-Pro-2 [0x0-0x1c01c].com.pjrc.teensy[221]: remote connection closed
Feb  2 11:31:52 pauls-MacBook-Pro-2 [0x0-0x1c01c].com.pjrc.teensy[221]: remote connection opened
Feb  2 11:31:52 pauls-MacBook-Pro-2 [0x0-0x1c01c].com.pjrc.teensy[221]: remote cmd: "comment: Teensyduino 1.11 - MACOSX"
Feb  2 11:31:52 pauls-MacBook-Pro-2 [0x0-0x1c01c].com.pjrc.teensy[221]: file changed
Feb  2 11:31:52 pauls-MacBook-Pro-2 [0x0-0x1c01c].com.pjrc.teensy[221]: File "staff_mpu_fastspi_sd.cpp.hex". 26592 bytes, 20% used
Feb  2 11:31:52 pauls-MacBook-Pro-2 [0x0-0x33b33b].cc.arduino.Arduino.teensyduino[14676]: Teensy Loader could not find the directory /var/folders/p6/n8_p41b974qf8dzx7r_8nb2m0000gn/T/build8794368102834605621.tmp
Feb  2 11:31:52 pauls-MacBook-Pro-2 [0x0-0x1c01c].com.pjrc.teensy[221]: remote cmd: "dir:/var/folders/p6/n8_p41b974qf8dzx7r_8nb2m0000gn/T/build8794368102834605621.tmp/"
Feb  2 11:31:53 pauls-MacBook-Pro-2 [0x0-0x1c01c].com.pjrc.teensy[221]: remote cmd: "file:staff_mpu_fastspi_sd.cpp.hex"
Feb  2 11:31:53 pauls-MacBook-Pro-2 [0x0-0x1c01c].com.pjrc.teensy[221]: File "staff_mpu_fastspi_sd.cpp.hex". 26592 bytes, 20% used
Feb  2 11:31:53 pauls-MacBook-Pro-2 [0x0-0x1c01c].com.pjrc.teensy[221]: remote connection closed
Feb  2 11:31:54 pauls-MacBook-Pro-2 [0x0-0x1c01c].com.pjrc.teensy[221]: remote connection opened
Feb  2 11:31:54 pauls-MacBook-Pro-2 [0x0-0x1c01c].com.pjrc.teensy[221]: remote cmd: "comment: Teensyduino 1.11 - MACOSX"
Feb  2 11:31:54 pauls-MacBook-Pro-2 [0x0-0x1c01c].com.pjrc.teensy[221]: file changed
Feb  2 11:31:54 pauls-MacBook-Pro-2 [0x0-0x1c01c].com.pjrc.teensy[221]: File "staff_mpu_fastspi_sd.cpp.hex". 26592 bytes, 20% used
Feb  2 11:31:54 pauls-MacBook-Pro-2 [0x0-0x33b33b].cc.arduino.Arduino.teensyduino[14676]: Teensy Loader could not find the directory /var/folders/p6/n8_p41b974qf8dzx7r_8nb2m0000gn/T/build8794368102834605621.tmp
Feb  2 11:31:54 pauls-MacBook-Pro-2 [0x0-0x1c01c].com.pjrc.teensy[221]: remote cmd: "dir:/var/folders/p6/n8_p41b974qf8dzx7r_8nb2m0000gn/T/build8794368102834605621.tmp/"
Feb  2 11:31:54 pauls-MacBook-Pro-2 [0x0-0x1c01c].com.pjrc.teensy[221]: remote cmd: "file:staff_mpu_fastspi_sd.cpp.hex"
Feb  2 11:31:54 pauls-MacBook-Pro-2 [0x0-0x1c01c].com.pjrc.teensy[221]: File "staff_mpu_fastspi_sd.cpp.hex". 26592 bytes, 20% used
Feb  2 11:31:54 pauls-MacBook-Pro-2 [0x0-0x1c01c].com.pjrc.teensy[221]: remote connection closed
Feb  2 11:31:59 pauls-MacBook-Pro-2 [0x0-0x1c01c].com.pjrc.teensy[221]: remote connection opened
Feb  2 11:31:59 pauls-MacBook-Pro-2 [0x0-0x1c01c].com.pjrc.teensy[221]: remote cmd: "comment: Teensyduino 1.11 - MACOSX"
Feb  2 11:31:59 pauls-MacBook-Pro-2 [0x0-0x1c01c].com.pjrc.teensy[221]: file changed
Feb  2 11:31:59 pauls-MacBook-Pro-2 [0x0-0x1c01c].com.pjrc.teensy[221]: File "staff_mpu_fastspi_sd.cpp.hex". 26592 bytes, 20% used
Feb  2 11:31:59 pauls-MacBook-Pro-2 [0x0-0x33b33b].cc.arduino.Arduino.teensyduino[14676]: Teensy Loader could not find the directory /var/folders/p6/n8_p41b974qf8dzx7r_8nb2m0000gn/T/build8794368102834605621.tmp
Feb  2 11:31:59 pauls-MacBook-Pro-2 [0x0-0x1c01c].com.pjrc.teensy[221]: remote cmd: "dir:/var/folders/p6/n8_p41b974qf8dzx7r_8nb2m0000gn/T/build8794368102834605621.tmp/"
Feb  2 11:31:59 pauls-MacBook-Pro-2 [0x0-0x1c01c].com.pjrc.teensy[221]: remote cmd: "file:staff_mpu_fastspi_sd.cpp.hex"
Feb  2 11:31:59 pauls-MacBook-Pro-2 [0x0-0x1c01c].com.pjrc.teensy[221]: File "staff_mpu_fastspi_sd.cpp.hex". 26592 bytes, 20% used
Feb  2 11:31:59 pauls-MacBook-Pro-2 [0x0-0x1c01c].com.pjrc.teensy[221]: remote connection closed
Feb  2 11:32:01 pauls-MacBook-Pro-2 [0x0-0x1c01c].com.pjrc.teensy[221]: remote connection opened
Feb  2 11:32:01 pauls-MacBook-Pro-2 [0x0-0x1c01c].com.pjrc.teensy[221]: file changed
Feb  2 11:32:01 pauls-MacBook-Pro-2 [0x0-0x1c01c].com.pjrc.teensy[221]: File "staff_mpu_fastspi_sd.cpp.hex". 26592 bytes, 20% used
Feb  2 11:32:01 pauls-MacBook-Pro-2 [0x0-0x33b33b].cc.arduino.Arduino.teensyduino[14676]: Teensy Loader error responding to comment
Feb  2 11:32:01 pauls-MacBook-Pro-2 [0x0-0x1c01c].com.pjrc.teensy[221]: remote cmd: "comment: Teensyduino 1.11 - MACOSX"
Feb  2 11:32:01 pauls-MacBook-Pro-2 [0x0-0x1c01c].com.pjrc.teensy[221]: remote connection closed

Is it possible to just set a fixed tmp dir in the config somewhere?
 
Is it possible to just set a fixed tmp dir in the config somewhere?

Well, that may be possible, but would it solve this problem? Without truly understanding what's really going on, I simply don't know yet. My gut feeling is there's probably something else wrong that's merely manifesting as this error.

The temporary directory is created by the Arduino IDE. The compiler is run on at least 1 file using this directory for output. Lots of other stuff happens too, before the final step where communication happens between Arduino and Teensy Loader. If the directory didn't actually exist, those earlier steps would fail.

These logs are really helpful, but they're half of the story. The other half is inside Teensy Loader's "Verbose Info". Next time you see this error, could you grab both the console log and the Teensy Loader verbose info? Also, if you could open up a terminal and use "ls -la /var/folders/dir..." to look at the actual directory. That way you can confirm if the directory actually does exist. Maybe there will be some obvious problem like permissions?

But I suspect there's some other subtle problem here. I honestly don't know what it could be. This doesn't happen on my mac... or at least not in the testing I've done, but I primarily use Linux and test only occasionally on Mac and Windows. If there's anything I could do to try reproducing the problem here, please let me know.
 
BTW, when I go look to see if the dir is there, it exists:

pauls-MacBook-Pro-2$ ls -ld /var/folders/p6/n8_p41b974qf8dzx7r_8nb2m0000gn/T/build6870987674787699379.tmp
drwxr-xr-x 74 paul staff 2516 Feb 2 13:32 /var/folders/p6/n8_p41b974qf8dzx7r_8nb2m0000gn/T/build6870987674787699379.tmp
 
Whoops I only now see you responded, Paul.

Where can I find the Teensy Loader's Verbose Info?

Sorry, still very new to all this...
 
Where can I find the Teensy Loader's Verbose Info?

It should be in the Teensyduino preferences under the file menu.
'Show verbose output during: compilation and/or upload'

(I still havent been able to trigger this error under Windows)
 
So Teensyduino here is actually just the installer. On the Mac it's called just "teensy", and then it's under "Window" -> "Verbose Information".

I just fired up my beta 12 app copy again, and now the error is more different: an immediate open/close, and also more persistent. I do eventually get to upload new code again, but it takes a number of tries. This is from the loader's Verbose Information window:

Code:
14:38:34: remote connection opened
14:38:34: file changed
14:38:34: File "staff_mpu_fastspi_sd.cpp.hex". 28740 bytes, 22% used
14:38:34: remote cmd: "comment: Teensyduino 1.12-beta12 - MACOSX"
14:38:35: remote connection closed
14:38:47: remote connection opened
14:38:48: file changed
14:38:48: File "staff_mpu_fastspi_sd.cpp.hex". 28740 bytes, 22% used
14:38:48: remote cmd: "comment: Teensyduino 1.12-beta12 - MACOSX"
14:38:48: remote connection closed
14:38:54: remote connection opened
14:38:54: file changed
14:38:54: File "staff_mpu_fastspi_sd.cpp.hex". 28740 bytes, 22% used
14:38:54: remote cmd: "comment: Teensyduino 1.12-beta12 - MACOSX"
14:38:54: remote connection closed
14:38:59: remote connection opened
14:38:59: file changed
14:38:59: File "staff_mpu_fastspi_sd.cpp.hex". 28740 bytes, 22% used
14:38:59: remote cmd: "comment: Teensyduino 1.12-beta12 - MACOSX"
14:38:59: remote connection closed
14:39:02: remote connection opened
14:39:02: file changed
14:39:02: File "staff_mpu_fastspi_sd.cpp.hex". 28740 bytes, 22% used
14:39:02: remote cmd: "comment: Teensyduino 1.12-beta12 - MACOSX"
14:39:02: remote connection closed
14:39:05: remote connection opened
14:39:05: file changed
14:39:05: File "staff_mpu_fastspi_sd.cpp.hex". 28740 bytes, 22% used
14:39:05: remote cmd: "comment: Teensyduino 1.12-beta12 - MACOSX"
14:39:06: remote connection closed
14:39:08: remote connection opened
14:39:08: file changed
14:39:08: File "staff_mpu_fastspi_sd.cpp.hex". 28740 bytes, 22% used
14:39:08: remote cmd: "comment: Teensyduino 1.12-beta12 - MACOSX"
14:39:09: remote connection closed
14:39:10: remote connection opened
14:39:10: remote cmd: "comment: Teensyduino 1.12-beta12 - MACOSX"
14:39:10: remote cmd: "dir:/var/folders/p6/n8_p41b974qf8dzx7r_8nb2m0000gn/T/build7158115397884075246.tmp/"
14:39:10: remote cmd: "file:staff_mpu_fastspi_sd.cpp.hex"
14:39:10: File "staff_mpu_fastspi_sd.cpp.hex". 28740 bytes, 22% used
14:39:10: remote cmd: "status"
14:39:11: status data sent
14:39:11: remote connection opened
14:39:11: remote connection closed
14:39:11: remote cmd: "status"
14:39:11: status data sent
14:39:11: remote cmd: "status"
14:39:11: status data sent
14:39:11: remote cmd: "status"
14:39:11: status data sent
14:39:11: remote cmd: "status"
14:39:11: status data sent
14:39:12: remote cmd: "status"
14:39:12: status data sent
14:39:12: remote cmd: "status"
14:39:12: status data sent
14:39:12: Device came online, code_size = 131072
14:39:12: Board is: Teensy 3.0 (MK20DX128)
14:39:12: File "staff_mpu_fastspi_sd.cpp.hex". 28740 bytes, 22% used
14:39:12: File "staff_mpu_fastspi_sd.cpp.hex". 28740 bytes, 22% used
14:39:12: found elf file
14:39:13: Code size from .elf file = 0
14:39:13: begin operation
14:39:13: remote cmd: "status"
14:39:13: status data sent
14:39:13: remote connection closed
14:39:13: flash, block=0, bs=1024, auto=1
14:39:13: HID/macos: waiting for device
14:39:13: flash, block=1, bs=1024, auto=1
14:39:13: flash, block=2, bs=1024, auto=1
14:39:13: flash, block=3, bs=1024, auto=1
14:39:13: flash, block=4, bs=1024, auto=1
14:39:14: flash, block=5, bs=1024, auto=1
14:39:14: flash, block=6, bs=1024, auto=1
14:39:14: HID/macos: waiting for device
14:39:14: flash, block=7, bs=1024, auto=1
14:39:14: flash, block=8, bs=1024, auto=1
14:39:14: flash, block=9, bs=1024, auto=1
14:39:14: flash, block=10, bs=1024, auto=1
14:39:14: flash, block=11, bs=1024, auto=1
14:39:14: flash, block=12, bs=1024, auto=1
14:39:14: HID/macos: waiting for device
14:39:14: flash, block=13, bs=1024, auto=1
14:39:15: flash, block=14, bs=1024, auto=1
14:39:15: flash, block=15, bs=1024, auto=1
14:39:15: flash, block=16, bs=1024, auto=1
14:39:15: flash, block=17, bs=1024, auto=1
14:39:15: flash, block=18, bs=1024, auto=1
14:39:15: flash, block=19, bs=1024, auto=1
14:39:15: flash, block=20, bs=1024, auto=1
14:39:15: flash, block=21, bs=1024, auto=1
14:39:15: flash, block=22, bs=1024, auto=1
14:39:15: HID/macos: waiting for device
14:39:15: flash, block=23, bs=1024, auto=1
14:39:16: flash, block=24, bs=1024, auto=1
14:39:16: flash, block=25, bs=1024, auto=1
14:39:16: flash, block=26, bs=1024, auto=1
14:39:16: flash, block=27, bs=1024, auto=1
14:39:16: flash, block=28, bs=1024, auto=1
14:39:16: HID/macos: waiting for device
14:39:16: sending reboot
14:39:16: begin wait_until_offline
14:39:16: HID/macos: status: ok
14:39:16: offline, waited 2
14:39:17: end operation
14:39:17: redraw timer set, image 14 to show for 1200 ms
14:39:17: HID/macos: number of devices found = 0
14:39:17: HID/macos: no devices found (empty set)
14:39:18: redraw, image 9
 
And this is what I get for the earlier error, in the Verbose Information window:

Code:
14:50:10: remote connection opened
14:50:10: remote cmd: "comment: Teensyduino 1.12-beta12 - MACOSX"
14:50:10: file changed
14:50:10: File "staff_mpu_fastspi_sd.cpp.hex". 28764 bytes, 22% used
14:50:10: remote cmd: "dir:/var/folders/p6/n8_p41b974qf8dzx7r_8nb2m0000gn/T/build7158115397884075246.tmp/"
14:50:10: remote cmd: "file:staff_mpu_fastspi_sd.cpp.hex"
14:50:10: File "staff_mpu_fastspi_sd.cpp.hex". 28764 bytes, 22% used
14:50:11: remote connection closed

And this in my Mac's system.log:

Code:
Feb  2 14:50:10 pauls-MacBook-Pro-2 [0x0-0x1c01c].com.pjrc.teensy[221]: remote connection opened
Feb  2 14:50:10 pauls-MacBook-Pro-2 [0x0-0x1c01c].com.pjrc.teensy[221]: remote cmd: "comment: Teensyduino 1.12-beta12 - MACOSX"
Feb  2 14:50:10 pauls-MacBook-Pro-2 [0x0-0x1c01c].com.pjrc.teensy[221]: file changed
Feb  2 14:50:10 pauls-MacBook-Pro-2 [0x0-0x1c01c].com.pjrc.teensy[221]: File "staff_mpu_fastspi_sd.cpp.hex". 28764 bytes, 22% used
Feb  2 14:50:10 pauls-MacBook-Pro-2 [0x0-0x356356].cc.arduino.Arduino.teensyduino[16091]: Teensy Loader could not find the directory /var/folders/p6/n8_p41b974qf8dzx7r_8nb2m0000gn/T/build7158115397884075246.tmp
Feb  2 14:50:10 pauls-MacBook-Pro-2 [0x0-0x1c01c].com.pjrc.teensy[221]: remote cmd: "dir:/var/folders/p6/n8_p41b974qf8dzx7r_8nb2m0000gn/T/build7158115397884075246.tmp/"
Feb  2 14:50:10 pauls-MacBook-Pro-2 [0x0-0x1c01c].com.pjrc.teensy[221]: remote cmd: "file:staff_mpu_fastspi_sd.cpp.hex"
Feb  2 14:50:11 pauls-MacBook-Pro-2 [0x0-0x1c01c].com.pjrc.teensy[221]: File "staff_mpu_fastspi_sd.cpp.hex". 28764 bytes, 22% used
Feb  2 14:50:11 pauls-MacBook-Pro-2 [0x0-0x1c01c].com.pjrc.teensy[221]: remote connection closed

Not much extra in the Verbose log I have to say. Do I need to switch on anything to have it get more verbose?
 
And here is the directory at that time:

Code:
pauls-MacBook-Pro-2:Applications paul$ ls -la /var/folders/p6/n8_p41b974qf8dzx7r_8nb2m0000gn/T/build7158115397884075246.tmp
total 2680
drwxr-xr-x  78 paul  staff    2652 Feb  2 14:50 .
drwx------  21 paul  staff     714 Feb  2 14:50 ..
drwxr-xr-x   5 paul  staff     170 Feb  2 14:37 FastSPI_LED
-rw-r--r--   1 paul  staff    1088 Feb  2 14:37 HardwareSerial1.cpp.d
-rw-r--r--   1 paul  staff   19284 Feb  2 14:37 HardwareSerial1.cpp.o
-rw-r--r--   1 paul  staff    1088 Feb  2 14:37 HardwareSerial2.cpp.d
-rw-r--r--   1 paul  staff   23400 Feb  2 14:37 HardwareSerial2.cpp.o
-rw-r--r--   1 paul  staff    1088 Feb  2 14:37 HardwareSerial3.cpp.d
-rw-r--r--   1 paul  staff   23400 Feb  2 14:37 HardwareSerial3.cpp.o
drwxr-xr-x   5 paul  staff     170 Feb  2 14:37 I2Cdev
-rw-r--r--   1 paul  staff    3387 Feb  2 14:37 IPAddress.cpp.d
-rw-r--r--   1 paul  staff   13644 Feb  2 14:37 IPAddress.cpp.o
drwxr-xr-x   5 paul  staff     170 Feb  2 14:37 MPU6050
-rw-r--r--   1 paul  staff     739 Feb  2 14:37 Print.cpp.d
-rw-r--r--   1 paul  staff   23596 Feb  2 14:37 Print.cpp.o
drwxr-xr-x   7 paul  staff     238 Feb  2 14:37 SD
-rw-r--r--   1 paul  staff    3163 Feb  2 14:37 Stream.cpp.d
-rw-r--r--   1 paul  staff   31004 Feb  2 14:37 Stream.cpp.o
-rw-r--r--   1 paul  staff     198 Feb  2 14:37 WMath.cpp.d
-rw-r--r--   1 paul  staff    7004 Feb  2 14:37 WMath.cpp.o
-rw-r--r--   1 paul  staff     422 Feb  2 14:37 WString.cpp.d
-rw-r--r--   1 paul  staff   75548 Feb  2 14:37 WString.cpp.o
drwxr-xr-x   5 paul  staff     170 Feb  2 14:37 Wire
-rw-r--r--   1 paul  staff     526 Feb  2 14:37 analog.c.d
-rw-r--r--   1 paul  staff    8944 Feb  2 14:37 analog.c.o
-rw-r--r--   1 paul  staff     305 Feb  2 14:37 eeprom.c.d
-rw-r--r--   1 paul  staff    8404 Feb  2 14:37 eeprom.c.o
-rw-r--r--   1 paul  staff     426 Feb  2 14:37 keylayouts.c.d
-rw-r--r--   1 paul  staff    2388 Feb  2 14:37 keylayouts.c.o
-rw-r--r--   1 paul  staff    3159 Feb  2 14:37 main.cpp.d
-rw-r--r--   1 paul  staff    3892 Feb  2 14:37 main.cpp.o
-rw-r--r--   1 paul  staff     311 Feb  2 14:37 mk20dx128.c.d
-rw-r--r--   1 paul  staff   11676 Feb  2 14:37 mk20dx128.c.o
-rw-r--r--   1 paul  staff     309 Feb  2 14:37 nonstd.c.d
-rw-r--r--   1 paul  staff    5372 Feb  2 14:37 nonstd.c.o
-rw-r--r--   1 paul  staff     650 Feb  2 14:37 pins_teensy.c.d
-rw-r--r--   1 paul  staff   31628 Feb  2 14:37 pins_teensy.c.o
-rw-r--r--   1 paul  staff     642 Feb  2 14:37 serial1.c.d
-rw-r--r--   1 paul  staff   13796 Feb  2 14:37 serial1.c.o
-rw-r--r--   1 paul  staff     642 Feb  2 14:37 serial2.c.d
-rw-r--r--   1 paul  staff    9976 Feb  2 14:37 serial2.c.o
-rw-r--r--   1 paul  staff     642 Feb  2 14:37 serial3.c.d
-rw-r--r--   1 paul  staff    9976 Feb  2 14:37 serial3.c.o
-rw-r--r--   1 paul  staff    5444 Feb  2 14:50 staff.h
-rw-r--r--   1 paul  staff   23448 Feb  2 14:50 staff_mpu_fastspi_sd.cpp
-rw-r--r--   1 paul  staff    4545 Feb  2 14:50 staff_mpu_fastspi_sd.cpp.d
-rw-r--r--   1 paul  staff      13 Feb  2 14:50 staff_mpu_fastspi_sd.cpp.eep
-rwxr-xr-x   1 paul  staff  527111 Feb  2 14:50 staff_mpu_fastspi_sd.cpp.elf
-rw-r--r--   1 paul  staff   80928 Feb  2 14:50 staff_mpu_fastspi_sd.cpp.hex
-rw-r--r--   1 paul  staff  107656 Feb  2 14:50 staff_mpu_fastspi_sd.cpp.o
-rw-r--r--   1 paul  staff     524 Feb  2 14:37 touch.c.d
-rw-r--r--   1 paul  staff    4548 Feb  2 14:37 touch.c.o
-rw-r--r--   1 paul  staff     308 Feb  2 14:37 usb_desc.c.d
-rw-r--r--   1 paul  staff    4308 Feb  2 14:37 usb_desc.c.o
-rw-r--r--   1 paul  staff     629 Feb  2 14:37 usb_dev.c.d
-rw-r--r--   1 paul  staff   22400 Feb  2 14:37 usb_dev.c.o
-rw-r--r--   1 paul  staff     979 Feb  2 14:37 usb_flightsim.cpp.d
-rw-r--r--   1 paul  staff    2452 Feb  2 14:37 usb_flightsim.cpp.o
-rw-r--r--   1 paul  staff    3167 Feb  2 14:37 usb_inst.cpp.d
-rw-r--r--   1 paul  staff   21376 Feb  2 14:37 usb_inst.cpp.o
-rw-r--r--   1 paul  staff    1086 Feb  2 14:37 usb_joystick.c.d
-rw-r--r--   1 paul  staff    2428 Feb  2 14:37 usb_joystick.c.o
-rw-r--r--   1 paul  staff    1194 Feb  2 14:37 usb_keyboard.c.d
-rw-r--r--   1 paul  staff    2428 Feb  2 14:37 usb_keyboard.c.o
-rw-r--r--   1 paul  staff     629 Feb  2 14:37 usb_mem.c.d
-rw-r--r--   1 paul  staff    7396 Feb  2 14:37 usb_mem.c.o
-rw-r--r--   1 paul  staff    1074 Feb  2 14:37 usb_midi.c.d
-rw-r--r--   1 paul  staff    2400 Feb  2 14:37 usb_midi.c.o
-rw-r--r--   1 paul  staff    1077 Feb  2 14:37 usb_mouse.c.d
-rw-r--r--   1 paul  staff    2424 Feb  2 14:37 usb_mouse.c.o
-rw-r--r--   1 paul  staff     966 Feb  2 14:37 usb_rawhid.c.d
-rw-r--r--   1 paul  staff    2428 Feb  2 14:37 usb_rawhid.c.o
-rw-r--r--   1 paul  staff     966 Feb  2 14:37 usb_seremu.c.d
-rw-r--r--   1 paul  staff    2408 Feb  2 14:37 usb_seremu.c.o
-rw-r--r--   1 paul  staff     966 Feb  2 14:37 usb_serial.c.d
-rw-r--r--   1 paul  staff   11552 Feb  2 14:37 usb_serial.c.o
-rw-r--r--   1 paul  staff     194 Feb  2 14:37 yield.c.d
-rw-r--r--   1 paul  staff    2120 Feb  2 14:37 yield.c.o
pauls-MacBook-Pro-2:Applications paul$
 
I killed the teensyloader and also some runaway processes:

Code:
pauls-MacBook-Pro-2:Arduino paul$ ps auxww|grep teensy
paul           16525  67.1  0.0   599640    364   ??  R     2:53PM   2:42.06 /Applications/Arduino-1.0.3-teensy-1.12/Contents/Resources/Java/hardware/tools/teensy_post_compile -board=teensy3 -tools=/Applications/Arduino-1.0.3-teensy-1.12/Contents/Resources/Java/hardware/tools/ -path=/var/folders/p6/n8_p41b974qf8dzx7r_8nb2m0000gn/T/build7158115397884075246.tmp -file=staff_mpu_fastspi_sd.cpp
paul           16578  65.7  0.0   599640    368   ??  R     2:53PM   2:45.48 /Applications/Arduino-1.0.3-teensy-1.12/Contents/Resources/Java/hardware/tools/teensy_post_compile -board=teensy3 -tools=/Applications/Arduino-1.0.3-teensy-1.12/Contents/Resources/Java/hardware/tools/ -path=/var/folders/p6/n8_p41b974qf8dzx7r_8nb2m0000gn/T/build7158115397884075246.tmp -file=staff_mpu_fastspi_sd.cpp
paul           16579  65.4  0.0   599640    364   ??  R     2:53PM   2:54.94 /Applications/Arduino-1.0.3-teensy-1.12/Contents/Resources/Java/hardware/tools/teensy_post_compile -board=teensy3 -tools=/Applications/Arduino-1.0.3-teensy-1.12/Contents/Resources/Java/hardware/tools/ -path=/var/folders/p6/n8_p41b974qf8dzx7r_8nb2m0000gn/T/build7158115397884075246.tmp -file=staff_mpu_fastspi_sd.cpp
paul           16586  65.3  0.0   599640    368   ??  R     2:53PM   2:47.73 /Applications/Arduino-1.0.3-teensy-1.12/Contents/Resources/Java/hardware/tools/teensy_post_compile -board=teensy3 -tools=/Applications/Arduino-1.0.3-teensy-1.12/Contents/Resources/Java/hardware/tools/ -path=/var/folders/p6/n8_p41b974qf8dzx7r_8nb2m0000gn/T/build7158115397884075246.tmp -file=staff_mpu_fastspi_sd.cpp
paul           16555  64.9  0.0   599640    364   ??  R     2:53PM   2:54.25 /Applications/Arduino-1.0.3-teensy-1.12/Contents/Resources/Java/hardware/tools/teensy_post_compile -board=teensy3 -tools=/Applications/Arduino-1.0.3-teensy-1.12/Contents/Resources/Java/hardware/tools/ -path=/var/folders/p6/n8_p41b974qf8dzx7r_8nb2m0000gn/T/build7158115397884075246.tmp -file=staff_mpu_fastspi_sd.cpp
paul           16743   0.1  0.4   742800  15092   ??  S     2:54PM   0:02.43 /Applications/Arduino-1.0.3-teensy-1.12/Contents/Resources/Java/hardware/tools/teensy.app/Contents/MacOS/teensy -psn_0_3548002

And now the problem isn't occurring. I also notice loading is going much faster again. Let's see how this goes...
 
No one interested in helping me on the arm-none-eabi-ar archive issue?

Making better use of ar and reducing unnecessary memory use are on my TO-DO list. I worked on this a few months ago and ran into trouble, so as a temporary "fix", I just set the build process to link every .o file. That seems to be working very well, even though it causes the final file size to be a little larger than it probably would be otherwise.

Also an issue I want to investigate it how to get the linker to *not* link interrupt routines if no other functions from that same file are used. The AVR compiler does this somehow. I just haven't investigated deeply how it accomplishes that feat.

To be realistic, at the moment I have several much more urgent tasks on that TO-DO list. Improving the website documentation for Teensy 3.0, particularly the getting started and documenting new functions really needs to be done. I also have a WS2811 LED library that's been in beta testing for 1 week... I plan to release that within the next few days. I also have about 10 Arduino libraries to port. They're all easy, and most I already have hardware, but each will take 1-2 days to test and document. Less urgent, but becoming a problem, is how PJRC handles postal mail shipping (many manual steps). I really need to spend a little time making that process more automated.

But this linker stuff is on my TO-DO list. I won't forget about it. But as long as simply linking all the .o files works and the only downside is a little more memory usage, investigating this is really a lower priority than all other other things.
 
Making better use of ar and reducing unnecessary memory use are on my TO-DO list. I worked on this a few months ago and ran into trouble, so as a temporary "fix", I just set the build process to link every .o file. That seems to be working very well, even though it causes the final file size to be a little larger than it probably would be otherwise.

Also an issue I want to investigate it how to get the linker to *not* link interrupt routines if no other functions from that same file are used. The AVR compiler does this somehow. I just haven't investigated deeply how it accomplishes that feat.

If you compile all modules with -ffunction-sections (and optionally -fdata-sections), and then pass -Wl,--gc-sections to the linker (or just --gc-sections if you are calling the linker directly). It should enable the linker to garbage collect sections that aren't used. You may need to investigate weak references to avoid pulling in some things. Also, creating a linker map with cross references can be handy (-Wl,-Map=foo.out,--cref)

Now, doing a grep of an arduino 1.0.3 tree with teensy 1.12 overlaid, I see the following files set -ffunction-sections and/or --gc-sections:

Code:
./src/Compiler.java:      "-Wl,--gc-sections"+optRelax,
./src/Compiler.java:      "-ffunction-sections", // place each function in its own section
./src/Compiler.java:      "-ffunction-sections", // place each function in its own section
./libraries/OneWire/OneWire.h:// and -ffunction-sections when compiling, and Wl,--gc-sections
./hardware/teensy/cores/teensy3/Makefile:LDFLAGS = -Os -Wl,--gc-sections -mcpu=cortex-m4 -mthumb -Tmk20dx128.ld
./hardware/arduino/bootloaders/optiboot/Makefile:override LDFLAGS       = $(LDSECTIONS) -Wl,--relax -Wl,--gc-sections -nostartfiles -nostdlib
./hardware/arduino/bootloaders/caterina/Makefile:CFLAGS += -ffunction-sections
./hardware/arduino/bootloaders/caterina/Makefile:LDFLAGS += -Wl,--gc-sections
./hardware/arduino/bootloaders/caterina-LilyPadUSB/Makefile:CFLAGS += -ffunction-sections
./hardware/arduino/bootloaders/caterina-LilyPadUSB/Makefile:LDFLAGS += -Wl,--gc-sections
./hardware/arduino/firmwares/atmegaxxu2/arduino-usbserial/makefile:CFLAGS += -ffunction-sections
./hardware/arduino/firmwares/atmegaxxu2/arduino-usbserial/makefile:LDFLAGS += -Wl,--gc-sections
./hardware/arduino/firmwares/atmegaxxu2/arduino-usbdfu/makefile:CFLAGS += -ffunction-sections
./hardware/arduino/firmwares/atmegaxxu2/arduino-usbdfu/makefile:LDFLAGS += -Wl,--gc-sections
./hardware/arduino/firmwares/wifishield/wifi_dnld/.cproject:<option id="gnu.c.link.option.ldflags.1902664612" name="Linker flags" superClass="gnu.c.link.option.ldflags" value="-Wl,--gc-sections -Wl,-e,_trampoline -T../src/SOFTWARE_FRAMEWORK/UTILS/LINKER_SCRIPTS/AT32UC3A/1256/GCC/link_uc3a1256.lds" valueType="string"/>
./hardware/arduino/firmwares/wifishield/wifi_dnld/.cproject:<option id="gnu.c.link.option.ldflags.183335601" name="Linker flags" superClass="gnu.c.link.option.ldflags" value="-Wl,--gc-sections -Wl,-e,_trampoline -T../src/SOFTWARE_FRAMEWORK/UTILS/LINKER_SCRIPTS/AT32UC3A/1256/GCC/link_uc3a1256.lds" valueType="string"/>
./hardware/arduino/firmwares/wifishield/wifiHD/.cproject:<option id="gnu.c.compiler.option.optimization.flags.1362317068" name="Other optimization flags" superClass="gnu.c.compiler.option.optimization.flags" value="-fdata-sections -ffunction-sections" valueType="string"/>
./hardware/arduino/firmwares/wifishield/wifiHD/.cproject:<option id="gnu.c.link.option.ldflags.569230699" name="Linker flags" superClass="gnu.c.link.option.ldflags" value="-Wl,--gc-sections -Wl,-e,_trampoline -T../src/SOFTWARE_FRAMEWORK/UTILS/LINKER_SCRIPTS/AT32UC3A/1256/GCC/link_uc3a1256.lds" valueType="string"/>
./hardware/arduino/firmwares/wifishield/wifiHD/.cproject:<option id="gnu.c.link.option.ldflags.870159720" name="Linker flags" superClass="gnu.c.link.option.ldflags" value="-Wl,--gc-sections -Wl,-e,_trampoline -T../src/SOFTWARE_FRAMEWORK/UTILS/LINKER_SCRIPTS/AT32UC3A/1256/GCC/link_uc3a1256.lds" valueType="string"/>
./hardware/arduino/firmwares/wifishield/wifiHD/.cproject:<option id="gnu.c.link.option.ldflags.87118628" name="Linker flags" superClass="gnu.c.link.option.ldflags" value="-Wl,--gc-sections" valueType="string"/>
./hardware/arduino/firmwares/wifishield/wifiHD/.cproject:<option id="gnu.c.link.option.ldflags.1722356522" name="Linker flags" superClass="gnu.c.link.option.ldflags" value="-Wl,--gc-sections" valueType="string"/>
./hardware/tools/arm-none-eabi/lib/gcc/arm-none-eabi/4.7.2/plugin/include/tree.h:   compiler via -ffunction-sections.  */
./hardware/tools/arm-none-eabi/lib/gcc/arm-none-eabi/4.7.2/plugin/include/options.h:  OPT_ffunction_cse = 586,                   /* -ffunction-cse */
./hardware/tools/arm-none-eabi/lib/gcc/arm-none-eabi/4.7.2/plugin/include/options.h:  OPT_ffunction_sections = 587,              /* -ffunction-sections */

(the last three are just artifacts from the compiler switch support for plugins). :cool: (hmm, we really need the :nerd: smilies that some other forums have)

To be realistic, at the moment I have several much more urgent tasks on that TO-DO list. Improving the website documentation for Teensy 3.0, particularly the getting started and documenting new functions really needs to be done. I also have a WS2811 LED library that's been in beta testing for 1 week... I plan to release that within the next few days. I also have about 10 Arduino libraries to port. They're all easy, and most I already have hardware, but each will take 1-2 days to test and document. Less urgent, but becoming a problem, is how PJRC handles postal mail shipping (many manual steps). I really need to spend a little time making that process more automated.

But this linker stuff is on my TO-DO list. I won't forget about it. But as long as simply linking all the .o files works and the only downside is a little more memory usage, investigating this is really a lower priority than all other other things.
Yes, it would be nice to have better documentation, including things in teensy that aren't in Arduino (or things that don't yet work).
 
Last edited:
Update on the unexpected size of the hex with latest release of Teensyduino featuring gcc 4.7.2

Standard procedure, working on both 4.4.1 and 4.7.2
Code:
../tools/arm-none-eabi/bin/arm-none-eabi-gcc -mcpu=cortex-m4 -lm -Wl,--gc-sections -Os -Tmk20dx128.ld -mthumb -o embeddedcomputing.elf analog.o eeprom.o keylayouts.o mk20dx128.o nonstd.o pins_teensy.o serial1.o serial2.o serial3.o touch.o usb_desc.o usb_dev.o usb_joystick.o usb_keyboard.o usb_mem.o usb_midi.o usb_mouse.o usb_rawhid.o usb_seremu.o usb_serial.o yield.o HardwareSerial1.o HardwareSerial2.o HardwareSerial3.o IPAddress.o Print.o Stream.o WMath.o WString.o usb_flightsim.o usb_inst.o LocalLibrary.o main.o -lc -L.

Optimised procedure, with archive and then link, works on 4.4.1...
Code:
../tools/arm-none-eabi/bin/arm-none-eabi-ar vrcs embeddedcomputing.a analog.o eeprom.o keylayouts.o mk20dx128.o nonstd.o pins_teensy.o serial1.o serial2.o serial3.o touch.o usb_desc.o usb_dev.o usb_joystick.o usb_keyboard.o usb_mem.o usb_midi.o usb_mouse.o usb_rawhid.o usb_seremu.o usb_serial.o yield.o HardwareSerial1.o HardwareSerial2.o HardwareSerial3.o IPAddress.o Print.o Stream.o WMath.o WString.o usb_flightsim.o usb_inst.o

Code:
../tools/arm-none-eabi/bin/arm-none-eabi-gcc -mcpu=cortex-m4 -lm -Wl,--gc-sections,-verbose  -Os -Tmk20dx128.ld -mthumb -o embeddedcomputing.elf embeddedcomputing.a LocalLibrary.o main.o -lc -L.

...but doesn't work on 4.7.2
Code:
../tools/arm-none-eabi/bin/arm-none-eabi-ar vrcs embeddedcomputing.a analog.o eeprom.o keylayouts.o mk20dx128.o nonstd.o pins_teensy.o serial1.o serial2.o serial3.o touch.o usb_desc.o usb_dev.o usb_joystick.o usb_keyboard.o usb_mem.o usb_midi.o usb_mouse.o usb_rawhid.o usb_seremu.o usb_serial.o yield.o HardwareSerial1.o HardwareSerial2.o HardwareSerial3.o IPAddress.o Print.o Stream.o WMath.o WString.o usb_flightsim.o usb_inst.o

Code:
../tools/arm-none-eabi/bin/arm-none-eabi-gcc -mcpu=cortex-m4 -lm -Wl,--gc-sections,-verbose  -Os -Tmk20dx128.ld -mthumb -o embeddedcomputing.elf embeddedcomputing.a LocalLibrary.o main.o -lc -L.

Any idea?

While I don't understand all these command options, sometimes (when I want gcc to generate assembler output), I want to change them. The way I do this now is cut the (verbose mode) command from the Arduino window. Is there a better way ? Is the command line in a script somewhere where I can modify it ?
 
> Also an issue I want to investigate it how to get the linker to *not*
> link interrupt routines if no other functions from that same file are used.
> The AVR compiler does this somehow. I just haven't investigated deeply
> how it accomplishes that feat.

Wouldn't the normal way to do this kind of thing be to put the standard libs/modules into a static library, rather than a bunch of object files?

I suppose the arduino environment may not be capable of that.
 
I suppose the arduino environment may not be capable of that.

Well, all Arduino does is run the toolchain (*), so the question is whether the toolchain can do it, and if Arduino is running the tools with the proper command and options.

I tried this briefly, twice, but when it didn't work I just reverted to linking all the .o files. Eventually I'll investigate, but it's a lower priority than several other issues. If you or anyone else investigates in detail, or submits a patch, I'll be happy to accept it, or at least read carefully whatever you find when I do work on this. But please understand I have to prioritize tasks, and currently several other things are much more urgent.
 
> Also an issue I want to investigate it how to get the linker to *not*
> link interrupt routines if no other functions from that same file are used.
> The AVR compiler does this somehow. I just haven't investigated deeply
> how it accomplishes that feat.

Wouldn't the normal way to do this kind of thing be to put the standard libs/modules into a static library, rather than a bunch of object files?

I suppose the arduino environment may not be capable of that.
Not necessarily. If you have two modules a.o and b.o, that are part in separate libraries liba.a and libb.a. If a.o references a function in b.o and b.o reference a function in a.o, you will get a linker error, if you just use -la -lb on your command line, and the user's program references the function in b.o but not a.o. There is a linker option to group libraries together (bracketing the -l options with --start-group and --end-group).

The real problem is the libraries are not written with each function in a separate file. Then libraries have a chance of working. Otherwise, without using the compiler option -ffunctions-section and the linker option --gc-sections, every function compiled in a file is brought in from a library if there is any reference to any of its symbols.
 
Making better use of ar and reducing unnecessary memory use are on my TO-DO list. I worked on this a few months ago and ran into trouble, so as a temporary "fix", I just set the build process to link every .o file. That seems to be working very well, even though it causes the final file size to be a little larger than it probably would be otherwise.

Paul, thank you for your answer. I fully understand the priority!

This bug came with gcc release 4.7.2 but I've found a turn-around so Teensy 3.0 owners can enjoy embedXcode!

Good luck with the documentation!
 
For what it's worth, you can *add* compiler options, by editing hardware/teensy/boards.txt & restarting Arduino, to add (e.g.)
teensy3.build.cppoption2=-O3
teensy3.build.cppoption3=-ffunctions-section
etc, (just increment the number for each option you add). For example I've found it useful to dump an assembler output instead of actually compiling, by
teensy3.build.cppoption<N>=-S
 
Status
Not open for further replies.
Back
Top