Forum Rule: Always post complete source code & details to reproduce any issue!
Page 2 of 3 FirstFirst 1 2 3 LastLast
Results 26 to 50 of 62

Thread: Teensy 3.0 Beta12 Software

  1. #26
    Junior Member
    Join Date
    Jan 2013
    Posts
    2

    Teensyduino on Arm-Linux

    Will it be available in the future? Any prevision?

    Thanks

    Quote Originally Posted by PaulStoffregen View Post
    Teensyduino does not (yet) support ARM-based Linux.

  2. #27
    Senior Member
    Join Date
    Nov 2012
    Posts
    136

    Question

    Quote Originally Posted by MichaelMeissner View Post
    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 Bytes gcc 4.4.1 gcc 4.7.2 Difference
    embeddedcomputing.elf 159114 35863 -123251
    embeddedcomputing.hex 17060 3507 -13553
    IPAddress.o 17020 13640 -3380
    main.o 22676 21848 -828
    HardwareSerial2.o 24112 23396 -716
    HardwareSerial3.o 24112 23396 -716
    HardwareSerial1.o 19568 19280 -288
    yield.o 2224 2096 -128
    usb_desc.o 4348 4272 -76
    usb_inst.o 21444 21372 -72
    keylayouts.o 2352 2348 -4
    embeddedcomputing.eep 13 13 0
    eeprom.o 8332 8368 36
    serial2.o 9864 9936 72
    serial3.o 9864 9936 72
    touch.o 4400 4516 116
    usb_joystick.o 2216 2388 172
    usb_keyboard.o 2216 2388 172
    usb_midi.o 2188 2360 172
    usb_mouse.o 2212 2388 176
    usb_seremu.o 2192 2368 176
    LocalLibrary.o 4316 4556 240
    usb_mem.o 7096 7356 260
    analog.o 8520 8908 388
    usb_serial.o 11108 11516 408
    nonstd.o 4856 5320 464
    serial1.o 13128 13756 628
    mk20dx128.o 11004 11640 636
    WMath.o 6296 6964 668
    usb_dev.o 20872 22296 1424
    WString.o 73856 75496 1640
    Print.o 21180 23592 2412
    Stream.o 28468 31000 2532
    pins_teensy.o 27560 31596 4036
    embeddedcomputing.a 402714 413554 10840
    Last edited by Avenue33; 01-28-2013 at 06:04 PM.

  3. #28
    Junior Member
    Join Date
    Dec 2012
    Posts
    3
    HI all,

    SOLVED !
    just expand arduino 1.0.3 in good directory : program filesx86
    and enjoy
    button next is active.
    Regards,
    Jacques

  4. #29
    Senior Member
    Join Date
    Nov 2012
    Posts
    136

    Question

    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?

  5. #30
    Member neep's Avatar
    Join Date
    Jan 2013
    Location
    Amsterdam, NL
    Posts
    82
    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.

  6. #31
    Senior Member ZTiK.nl's Avatar
    Join Date
    Dec 2012
    Location
    Amsterdam
    Posts
    179
    Quote Originally Posted by neep View Post
    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 by ZTiK.nl; 02-01-2013 at 11:33 PM. Reason: added quote end-tag

  7. #32
    Member neep's Avatar
    Join Date
    Jan 2013
    Location
    Amsterdam, NL
    Posts
    82
    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?

  8. #33
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    20,581
    Quote Originally Posted by neep View Post
    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.

  9. #34
    Member neep's Avatar
    Join Date
    Jan 2013
    Location
    Amsterdam, NL
    Posts
    82
    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

  10. #35
    Member neep's Avatar
    Join Date
    Jan 2013
    Location
    Amsterdam, NL
    Posts
    82
    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...

  11. #36
    Senior Member ZTiK.nl's Avatar
    Join Date
    Dec 2012
    Location
    Amsterdam
    Posts
    179
    Quote Originally Posted by neep View Post
    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)

  12. #37
    Member neep's Avatar
    Join Date
    Jan 2013
    Location
    Amsterdam, NL
    Posts
    82
    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

  13. #38
    Member neep's Avatar
    Join Date
    Jan 2013
    Location
    Amsterdam, NL
    Posts
    82
    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?

  14. #39
    Member neep's Avatar
    Join Date
    Jan 2013
    Location
    Amsterdam, NL
    Posts
    82
    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$

  15. #40
    Member neep's Avatar
    Join Date
    Jan 2013
    Location
    Amsterdam, NL
    Posts
    82
    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...

  16. #41
    Senior Member
    Join Date
    Nov 2012
    Posts
    136
    No one interested in helping me on the arm-none-eabi-ar archive issue?

  17. #42
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    20,581
    Quote Originally Posted by Avenue33 View Post
    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.

  18. #43
    Senior Member+ MichaelMeissner's Avatar
    Join Date
    Nov 2012
    Location
    Ayer Massachussetts
    Posts
    3,261

    Cool

    Quote Originally Posted by PaulStoffregen View Post
    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). (hmm, we really need the :nerd: smilies that some other forums have)

    Quote Originally Posted by PaulStoffregen View Post
    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 by MichaelMeissner; 02-04-2013 at 07:21 PM.

  19. #44
    Senior Member Jp3141's Avatar
    Join Date
    Nov 2012
    Posts
    458
    Quote Originally Posted by Avenue33 View Post
    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 ?

  20. #45
    Senior Member+ MichaelMeissner's Avatar
    Join Date
    Nov 2012
    Location
    Ayer Massachussetts
    Posts
    3,261
    At a guess, it is in src/Compiler.java, but I haven't done a deep dive on what the Arduino IDE does behind your back.

  21. #46
    Member
    Join Date
    Dec 2012
    Location
    Adelaide, SA
    Posts
    70
    > 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.

  22. #47
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    20,581
    Quote Originally Posted by ploveday View Post
    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.

  23. #48
    Senior Member+ MichaelMeissner's Avatar
    Join Date
    Nov 2012
    Location
    Ayer Massachussetts
    Posts
    3,261
    Quote Originally Posted by ploveday View Post
    > 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.

  24. #49
    Senior Member
    Join Date
    Nov 2012
    Posts
    136
    Quote Originally Posted by PaulStoffregen View Post
    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!

  25. #50
    Member
    Join Date
    Jan 2013
    Location
    Salem, MA
    Posts
    46
    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

Posting Permissions

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