Forum Rule: Always post complete source code & details to reproduce any issue!
Page 1 of 2 1 2 LastLast
Results 1 to 25 of 31

Thread: Error on second compile after Teensyduino and Arduino update

  1. #1
    Junior Member
    Join Date
    Dec 2019
    Posts
    5

    Error on second compile after Teensyduino and Arduino update

    Hello everyone,

    I have a bit of a strange problem. Yesterday I updated to Arduino 1.8.13 and Teensyduino 1.53.

    Now the second time I compile code for a certain project, it gives an error compiling. When I switch boards e.g. between Teensy 3.2 and 4.0, it compiles again. (Only the first time after switch)

    The verbose output is not very helpful:

    Code:
    Arduino: 1.8.13 (Windows 10), TD: 1.53, Board: "Teensy 4.0, Serial, 600 MHz, Faster, US English"
    
    
    
    
    
    C:\Program Files (x86)\Arduino\arduino-builder -dump-prefs -logger=machine -hardware C:\Program Files (x86)\Arduino\hardware -hardware C:\Users\username\Documents\Arduino\hardware -tools C:\Program Files (x86)\Arduino\tools-builder -tools C:\Program Files (x86)\Arduino\hardware\tools\avr -built-in-libraries C:\Program Files (x86)\Arduino\libraries -libraries C:\Users\username\Documents\Arduino\libraries -fqbn=teensy:avr:teensy40:usb=serial,speed=600,opt=o2std,keys=en-us -ide-version=10813 -build-path C:\Users\USRNM~1\AppData\Local\Temp\arduino_build_702706 -warnings=none -build-cache C:\Users\USRNM~1\AppData\Local\Temp\arduino_cache_632665 -verbose C:\Users\username\Documents\Local Git repos\Experimental Repos\test-repo\EtherCAT Tests\TestEasyCAT_Teensy\TestEasyCAT_Teensy.ino
    
    C:\Program Files (x86)\Arduino\arduino-builder -compile -logger=machine -hardware C:\Program Files (x86)\Arduino\hardware -hardware C:\Users\username\Documents\Arduino\hardware -tools C:\Program Files (x86)\Arduino\tools-builder -tools C:\Program Files (x86)\Arduino\hardware\tools\avr -built-in-libraries C:\Program Files (x86)\Arduino\libraries -libraries C:\Users\username\Documents\Arduino\libraries -fqbn=teensy:avr:teensy40:usb=serial,speed=600,opt=o2std,keys=en-us -ide-version=10813 -build-path C:\Users\USRNM~1\AppData\Local\Temp\arduino_build_702706 -warnings=none -build-cache C:\Users\USRNM~1\AppData\Local\Temp\arduino_cache_632665 -verbose C:\Users\username\Documents\Local Git repos\Repos\test-repo\EtherCAT Tests\TestEasyCAT_Teensy\TestEasyCAT_Teensy.ino
    
    Using board 'teensy40' from platform in folder: C:\Program Files (x86)\Arduino\hardware\teensy\avr
    
    Using core 'teensy4' from platform in folder: C:\Program Files (x86)\Arduino\hardware\teensy\avr
    
    Detecting libraries used...
    
    Error compiling for board Teensy 4.0.
    ( I changed the username and project name)

    Has anyone perhaps seen this before?

  2. #2
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    Posts
    7,642
    Your non-verbose information does not show any errors. So really can not tell you much.

    Other than I believe you are running on Windows.

    You might try pasting the verbose build data into a text editor and search for error to get some hints.

    Good luck

  3. #3
    Senior Member
    Join Date
    May 2015
    Location
    USA
    Posts
    641
    Yes, turn on file->preferences->verbose output and post all of it.

  4. #4
    Junior Member
    Join Date
    Dec 2019
    Posts
    5
    Unfortunately that is the verbose output. With verbose toggled off it gives

    Code:
    Arduino: 1.8.13 (Windows 10), TD: 1.53, Board: "Teensy 4.0, Serial, 600 MHz, Faster, US English"
    
    Error compiling for board Teensy 4.0.
    
    
    
    This report would have more information with
    "Show verbose output during compilation"
    option enabled in File -> Preferences.
    I'll try to fully remove Arduino/Teensyduino and see if that helps.

  5. #5
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    Posts
    7,642
    Yep - Not very verbose

    Also I always make sure that I have turned on to see all warnings: Compiler Warnings: <ALL>

    When I get cases like this, the other things I look at include:

    a) Did you have a recent update of Anti-virus code... I have had some of them give me screwy things, like maybe not allowing me to build.

    b) Clean out the temporary directory: I open directory window, and type in as address: %temp%
    Then clear most if not all of this out. Note: I first exit Arduino.

    c) Check disk space...

  6. #6
    Junior Member
    Join Date
    Dec 2019
    Posts
    5
    Thanks for the tips. Unfortunately, no dice.. even reinstalled 1.8.10 and 18.12. Switched to a VM for now, maybe Windows update will magically undo the problem

    Though I did find out it is not a Teensy issue, since it also happens when selecting e.g. the Uno. So it seems to be on the IDE side.

  7. #7
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    Posts
    7,642
    Sorry to hear that. Which (if any) Virus protection are you running? As an experiment, you might try turning it off and see if you can run multiple compiles. Maybe it is not letting the Arduino system not reuse the archive files that it created or???

  8. #8
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    22,688
    In Arduino, click File > Preferences...

    Click image for larger version. 

Name:	sc.png 
Views:	17 
Size:	70.8 KB 
ID:	21496

    ... then turn on verbose output for compilation.

    This will cause Arduino to print *lots* of info about the exact compiler commands it's running. Embedded in those commands will be the full pathnames, including the temporary folder where it's storing the compiled and cached files.

    Seeing that verbose output and a copy of that folder after the error might help. Without the ability to see the actual error and compiler commands and the temporary files the compiler actually used, we're just blind guessing.

    Odds are good you may have found an obscure bug in Arduino. But for anyone to have any chance of diagnosing and fixing it, this extra info will be needed.

  9. #9
    Senior Member
    Join Date
    Jul 2020
    Posts
    394
    I would recommend collecting the output from two compilations, one that works and the one that doesn't and posting both, the differences
    will hold the key.

  10. #10
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    Posts
    7,642
    Hi @PaulStoffregen - Note: in #4 he does say that the output in #1 was the verbose output... And in #4 he shows the non-verbose...

    Although I still wonder if he showed the FULL verbose... If so it feels like a Virus Protection system maybe not allowing Arduino to talk to one of the folders or Archives that the first run of Arduino created...
    But again just throwing a dart.

  11. #11
    Senior Member
    Join Date
    Jul 2020
    Posts
    174
    Same here...

    The version of the IDE shows as supported (1.8.13) when I run the Teensyduino installer. I'm trying to upload the HelloWorld example, so this doesn't depend on much. This is on Windows 10 Home, version 2004.

    The behavior is strange. If I verify once, it works, and then the Teensyduino program can burn it. However, if I press the upload button, it says that it can't compile it for Teensy 4.0. After that, verification doesn't work either.

    If I switch to Teensy 4.1, verify, then back to Teensy 4.0, I can upload from the IDE once, but after that verify and upload both break unless I switch to some other board, verify, and then switch back to Teensy 4.0. Closing and re-opening the IDE also makes it work, once.

    Merely switching to another board and then back is not enough to make it work. The verify step has to happen for the other board.

    Board info (just got this from Amazon yesterday):
    Code:
    BN: Teensy
    VID: 16C0
    PID: 0483
    SN: (null)
    Settings:
    • Board: Teensy 4.0
    • USB Type: Serial
    • CPU Speed: 600MHz
    • Optimize: Fast
    • Keyboard Layout: US English
    • Port: COM3 (Teensy) - also tried COM3 Serial (Teensy 4.0), no effect.


    Error output:
    Code:
    Arduino: 1.8.13 (Windows 10), TD: 1.53, Board: "Teensy 4.0, Serial, 600 MHz, Fast, US English"
    
    C:\Program Files (x86)\Arduino\arduino-builder -dump-prefs -logger=machine -hardware C:\Program Files (x86)\Arduino\hardware -tools C:\Program Files (x86)\Arduino\tools-builder -tools C:\Program Files (x86)\Arduino\hardware\tools\avr -built-in-libraries C:\Program Files (x86)\Arduino\libraries -libraries C:\Users\User\Documents\Arduino\libraries -fqbn=teensy:avr:teensy40:usb=serial,speed=600,opt=o1std,keys=en-us -ide-version=10813 -build-path C:\Users\User\AppData\Local\Temp\arduino_build_10178 -warnings=none -build-cache C:\Users\User\AppData\Local\Temp\arduino_cache_148605 -verbose C:\Program Files (x86)\Arduino\examples\Teensy\USB_Serial\HelloWorld\HelloWorld.pde
    
    C:\Program Files (x86)\Arduino\arduino-builder -compile -logger=machine -hardware C:\Program Files (x86)\Arduino\hardware -tools C:\Program Files (x86)\Arduino\tools-builder -tools C:\Program Files (x86)\Arduino\hardware\tools\avr -built-in-libraries C:\Program Files (x86)\Arduino\libraries -libraries C:\Users\User\Documents\Arduino\libraries -fqbn=teensy:avr:teensy40:usb=serial,speed=600,opt=o1std,keys=en-us -ide-version=10813 -build-path C:\Users\User\AppData\Local\Temp\arduino_build_10178 -warnings=none -build-cache C:\Users\User\AppData\Local\Temp\arduino_cache_148605 -verbose C:\Program Files (x86)\Arduino\examples\Teensy\USB_Serial\HelloWorld\HelloWorld.pde
    
    Using board 'teensy40' from platform in folder: C:\Program Files (x86)\Arduino\hardware\teensy\avr
    Using core 'teensy4' from platform in folder: C:\Program Files (x86)\Arduino\hardware\teensy\avr
    Detecting libraries used...
    Error compiling for board Teensy 4.0.
    This is with verbose output turned on.

    By comparison, this is what a successful compile looks like:
    Code:
    C:\Program Files (x86)\Arduino\arduino-builder -dump-prefs -logger=machine -hardware C:\Program Files (x86)\Arduino\hardware -tools C:\Program Files (x86)\Arduino\tools-builder -tools C:\Program Files (x86)\Arduino\hardware\tools\avr -built-in-libraries C:\Program Files (x86)\Arduino\libraries -libraries C:\Users\user\Documents\Arduino\libraries -fqbn=teensy:avr:teensy40:usb=serial,speed=600,opt=o2std,keys=en-us -vid-pid=16C0_0483 -ide-version=10813 -build-path C:\Users\user\AppData\Local\Temp\arduino_build_205504 -warnings=all -build-cache C:\Users\user\AppData\Local\Temp\arduino_cache_720445 -verbose C:\Program Files (x86)\Arduino\examples\Teensy\Serial\EchoBoth\EchoBoth.pde
    C:\Program Files (x86)\Arduino\arduino-builder -compile -logger=machine -hardware C:\Program Files (x86)\Arduino\hardware -tools C:\Program Files (x86)\Arduino\tools-builder -tools C:\Program Files (x86)\Arduino\hardware\tools\avr -built-in-libraries C:\Program Files (x86)\Arduino\libraries -libraries C:\Users\user\Documents\Arduino\libraries -fqbn=teensy:avr:teensy40:usb=serial,speed=600,opt=o2std,keys=en-us -vid-pid=16C0_0483 -ide-version=10813 -build-path C:\Users\user\AppData\Local\Temp\arduino_build_205504 -warnings=all -build-cache C:\Users\user\AppData\Local\Temp\arduino_cache_720445 -verbose C:\Program Files (x86)\Arduino\examples\Teensy\Serial\EchoBoth\EchoBoth.pde
    Using board 'teensy40' from platform in folder: C:\Program Files (x86)\Arduino\hardware\teensy\avr
    Using core 'teensy4' from platform in folder: C:\Program Files (x86)\Arduino\hardware\teensy\avr
    Detecting libraries used...
    "C:\\Program Files (x86)\\Arduino\\hardware\\teensy/../tools/arm/bin/arm-none-eabi-g++" -E -CC -x c++ -w -g -Wall -ffunction-sections -fdata-sections -nostdlib -std=gnu++14 -fno-exceptions -fpermissive -fno-rtti -fno-threadsafe-statics -felide-constructors -Wno-error=narrowing -mthumb -mcpu=cortex-m7 -mfloat-abi=hard -mfpu=fpv5-d16 -D__IMXRT1062__ -DTEENSYDUINO=153 -DARDUINO=10813 -DARDUINO_TEENSY40 -DF_CPU=600000000 -DUSB_SERIAL -DLAYOUT_US_ENGLISH "-IC:\\Program Files (x86)\\Arduino\\hardware\\teensy\\avr\\cores\\teensy4" "C:\\Users\\user\\AppData\\Local\\Temp\\arduino_build_205504\\sketch\\EchoBoth.pde.cpp" -o nul -DARDUINO_LIB_DISCOVERY_PHASE
    Generating function prototypes...
    "C:\\Program Files (x86)\\Arduino\\hardware\\teensy/../tools/arm/bin/arm-none-eabi-g++" -E -CC -x c++ -w -g -Wall -ffunction-sections -fdata-sections -nostdlib -std=gnu++14 -fno-exceptions -fpermissive -fno-rtti -fno-threadsafe-statics -felide-constructors -Wno-error=narrowing -mthumb -mcpu=cortex-m7 -mfloat-abi=hard -mfpu=fpv5-d16 -D__IMXRT1062__ -DTEENSYDUINO=153 -DARDUINO=10813 -DARDUINO_TEENSY40 -DF_CPU=600000000 -DUSB_SERIAL -DLAYOUT_US_ENGLISH "-IC:\\Program Files (x86)\\Arduino\\hardware\\teensy\\avr\\cores\\teensy4" "C:\\Users\\user\\AppData\\Local\\Temp\\arduino_build_205504\\sketch\\EchoBoth.pde.cpp" -o "C:\\Users\\user\\AppData\\Local\\Temp\\arduino_build_205504\\preproc\\ctags_target_for_gcc_minus_e.cpp" -DARDUINO_LIB_DISCOVERY_PHASE
    "C:\\Program Files (x86)\\Arduino\\tools-builder\\ctags\\5.8-arduino11/ctags" -u --language-force=c++ -f - --c++-kinds=svpf --fields=KSTtzns --line-directives "C:\\Users\\user\\AppData\\Local\\Temp\\arduino_build_205504\\preproc\\ctags_target_for_gcc_minus_e.cpp"
    Compiling sketch...
    "C:\\Program Files (x86)\\Arduino\\hardware\\teensy/../tools/precompile_helper" "C:\\Program Files (x86)\\Arduino\\hardware\\teensy\\avr/cores/teensy4" "C:\\Users\\user\\AppData\\Local\\Temp\\arduino_build_205504" "C:\\Program Files (x86)\\Arduino\\hardware\\teensy/../tools/arm/bin/arm-none-eabi-g++" -x c++-header -O2 -g -Wall -ffunction-sections -fdata-sections -nostdlib -MMD -std=gnu++14 -fno-exceptions -fpermissive -fno-rtti -fno-threadsafe-statics -felide-constructors -Wno-error=narrowing -mthumb -mcpu=cortex-m7 -mfloat-abi=hard -mfpu=fpv5-d16 -D__IMXRT1062__ -DTEENSYDUINO=153 -DARDUINO=10813 -DARDUINO_TEENSY40 -DF_CPU=600000000 -DUSB_SERIAL -DLAYOUT_US_ENGLISH "-IC:\\Program Files (x86)\\Arduino\\hardware\\teensy\\avr/cores/teensy4" "C:\\Users\\user\\AppData\\Local\\Temp\\arduino_build_205504/pch/Arduino.h" -o "C:\\Users\\user\\AppData\\Local\\Temp\\arduino_build_205504/pch/Arduino.h.gch"
    "C:\\Program Files (x86)\\Arduino\\hardware\\teensy/../tools/arm/bin/arm-none-eabi-g++" -c -O2 -g -Wall -ffunction-sections -fdata-sections -nostdlib -MMD -std=gnu++14 -fno-exceptions -fpermissive -fno-rtti -fno-threadsafe-statics -felide-constructors -Wno-error=narrowing -mthumb -mcpu=cortex-m7 -mfloat-abi=hard -mfpu=fpv5-d16 -D__IMXRT1062__ -DTEENSYDUINO=153 -DARDUINO=10813 -DARDUINO_TEENSY40 -DF_CPU=600000000 -DUSB_SERIAL -DLAYOUT_US_ENGLISH "-IC:\\Users\\user\\AppData\\Local\\Temp\\arduino_build_205504/pch" "-IC:\\Program Files (x86)\\Arduino\\hardware\\teensy\\avr\\cores\\teensy4" "C:\\Users\\user\\AppData\\Local\\Temp\\arduino_build_205504\\sketch\\EchoBoth.pde.cpp" -o "C:\\Users\\user\\AppData\\Local\\Temp\\arduino_build_205504\\sketch\\EchoBoth.pde.cpp.o"
    Compiling libraries...
    Compiling core...
    Using precompiled core: C:\Users\user\AppData\Local\Temp\arduino_cache_720445\core\core_88a2d4dfef9509c3677628f3762a6fb0.a
    Linking everything together...
    "C:\\Program Files (x86)\\Arduino\\hardware\\teensy/../tools/arm/bin/arm-none-eabi-gcc" -O2 -Wl,--gc-sections,--relax "-TC:\\Program Files (x86)\\Arduino\\hardware\\teensy\\avr\\cores\\teensy4/imxrt1062.ld" -mthumb -mcpu=cortex-m7 -mfloat-abi=hard -mfpu=fpv5-d16 -o "C:\\Users\\user\\AppData\\Local\\Temp\\arduino_build_205504/EchoBoth.pde.elf" "C:\\Users\\user\\AppData\\Local\\Temp\\arduino_build_205504\\sketch\\EchoBoth.pde.cpp.o" "C:\\Users\\user\\AppData\\Local\\Temp\\arduino_build_205504/..\\arduino_cache_720445\\core\\core_88a2d4dfef9509c3677628f3762a6fb0.a" "-LC:\\Users\\user\\AppData\\Local\\Temp\\arduino_build_205504" -larm_cortexM7lfsp_math -lm -lstdc++
    "C:\\Program Files (x86)\\Arduino\\hardware\\teensy/../tools/arm/bin/arm-none-eabi-objcopy" -O ihex -j .eeprom --set-section-flags=.eeprom=alloc,load --no-change-warnings --change-section-lma .eeprom=0 "C:\\Users\\user\\AppData\\Local\\Temp\\arduino_build_205504/EchoBoth.pde.elf" "C:\\Users\\user\\AppData\\Local\\Temp\\arduino_build_205504/EchoBoth.pde.eep"
    "C:\\Program Files (x86)\\Arduino\\hardware\\teensy/../tools/arm/bin/arm-none-eabi-objcopy" -O ihex -R .eeprom "C:\\Users\\user\\AppData\\Local\\Temp\\arduino_build_205504/EchoBoth.pde.elf" "C:\\Users\\user\\AppData\\Local\\Temp\\arduino_build_205504/EchoBoth.pde.hex"
    "C:\\Program Files (x86)\\Arduino\\hardware\\teensy/../tools/stdout_redirect" "C:\\Users\\user\\AppData\\Local\\Temp\\arduino_build_205504/EchoBoth.pde.lst" "C:\\Program Files (x86)\\Arduino\\hardware\\teensy/../tools/arm/bin/arm-none-eabi-objdump" -d -S -C "C:\\Users\\user\\AppData\\Local\\Temp\\arduino_build_205504/EchoBoth.pde.elf"
    "C:\\Program Files (x86)\\Arduino\\hardware\\teensy/../tools/stdout_redirect" "C:\\Users\\user\\AppData\\Local\\Temp\\arduino_build_205504/EchoBoth.pde.sym" "C:\\Program Files (x86)\\Arduino\\hardware\\teensy/../tools/arm/bin/arm-none-eabi-objdump" -t -C "C:\\Users\\user\\AppData\\Local\\Temp\\arduino_build_205504/EchoBoth.pde.elf"
    "C:\\Program Files (x86)\\Arduino\\hardware\\teensy/../tools/teensy_post_compile" -file=EchoBoth.pde "-path=C:\\Users\\user\\AppData\\Local\\Temp\\arduino_build_205504" "-tools=C:\\Program Files (x86)\\Arduino\\hardware\\teensy/../tools/" -board=TEENSY40
    Opening Teensy Loader...
    "C:\\Program Files (x86)\\Arduino\\hardware\\teensy/../tools/arm/bin/arm-none-eabi-size" -A "C:\\Users\\user\\AppData\\Local\\Temp\\arduino_build_205504/EchoBoth.pde.elf"
    Sketch uses 16416 bytes (0%) of program storage space. Maximum is 2031616 bytes.
    Global variables use 41660 bytes (7%) of dynamic memory, leaving 482628 bytes for local variables. Maximum is 524288 bytes.
    C:\Program Files (x86)\Arduino\hardware\teensy/../tools/teensy_post_compile -file=EchoBoth.pde -path=C:\Users\user\AppData\Local\Temp\arduino_build_205504 -tools=C:\Program Files (x86)\Arduino\hardware\teensy/../tools -board=TEENSY40 -reboot -port=COM3 -portlabel=COM3 -portprotocol=serial

  12. #12
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    Posts
    7,642
    Hi @pilot,

    Sounds screwy! So can only throw darts out here, as I am also running 1.8.13 current release Teensyduino on Windows 10....

    Maybe some additional information might help localize down the issue or things to maybe try:

    a) What version of Windows 10 are you running? I personally am running Version 1909 build 18363.1016

    b) Virus Protection - Which one? Did it recently update? Note: I run Norton 360 which I know some don't like... Not really sure what the best protection, least in the way one is... But have you tried turning it off and see if you can compile multiple times?

    c) Try clearing out your temp folder? Open directory window and go to directory %temp% and delete everything or at least everything that has a word in it like arduino...

    d) Do a clean install? Note: These days I don't personally install using the Windows Installer but instead use the zip file and I usually have a few versions installed.

    e) try a really clean install? That is try and rename the other places that Arduino looks and try running again. That includes your <sketches folder>/libraries
    it also includes the Arduino15 folder (Board manager and library manager use this folder) which on my machine/user is at: C:\Users\kurte\AppData\Local\Arduino15

    f) And do all of the normal things, like for disk space... ...

    Again sorry I am throwing some darts out there.

  13. #13
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    22,688
    Any chance you could try with Teensyduino 1.53 and some of the older versions of Arduino it supports (1.8.5, 1.8.9, 1.8.11, and 1.8.12)?

    This is a very mysterious problem which doesn't happen on any of my machines. Would really help to know if it only happens on certain versions of Arduino, or if all are the same?

  14. #14
    Senior Member
    Join Date
    Jul 2020
    Posts
    174
    It's in the toolchain somewhere.

    This is what it runs right after it echoes that it's doing library detection:
    Code:
    "C:\\Program Files (x86)\\Arduino\\hardware\\teensy/../tools/arm/bin/arm-none-eabi-g++" -E -CC -x c++ -w -g -Wall -ffunction-sections -fdata-sections -nostdlib -std=gnu++14 -fno-exceptions -fpermissive -fno-rtti -fno-threadsafe-statics -felide-constructors -Wno-error=narrowing -mthumb -mcpu=cortex-m7 -mfloat-abi=hard -mfpu=fpv5-d16 -D__IMXRT1062__ -DTEENSYDUINO=153 -DARDUINO=10813 -DARDUINO_TEENSY40 -DF_CPU=600000000 -DUSB_SERIAL -DLAYOUT_US_ENGLISH "-IC:\\Program Files (x86)\\Arduino\\hardware\\teensy\\avr\\cores\\teensy4" "C:\\Users\\user\\AppData\\Local\\Temp\\arduino_build_205504\\sketch\\EchoBoth.pde.cpp" -o nul -DARDUINO_LIB_DISCOVERY_PHASE
    If I run this in a shell, it's fine. I can run it again and again. If I verify again in the IDE, it breaks, but I can still run that line in a shell and it's fine.

    So it isn't getting that far. What happens in the toolchain between echoing the "library detection" message and running that command? Is anything sent to STDERR being redirected to a file somewhere?

    I'd like to help by debugging this in vivo, but I don't know anything about how Arduino IDE compiles stuff, or how Teensyduino plugs into it. I will start looking at what I can find on GitHub.
    Last edited by Pilot; 08-31-2020 at 09:59 PM.

  15. #15
    Senior Member
    Join Date
    Jul 2020
    Posts
    174
    Error happens in Compiler::callArduinoBuilder() on line 236:
    Code:
        if (result != 0) {
          RunnerException re = new RunnerException(I18n.format(tr("Error compiling for board {0}."), board.getName()));
          re.hideStackTrace();
          throw re;
        }
    result is the output of proc.waitFor(), created here:
    Code:
    Process proc = ProcessUtils.exec(cmd.toArray(new String[0]));
    Interestingly, just above that:
    Code:
        if (verbose) {
          System.out.println(StringUtils.join(cmd, ' '));
        }
    ...but verbosity is turned all the way up in the options, and it prints nothing. Given how many lines touch that array above this code, it doesn't seem like it could be empty, so in addition to whatever else is wrong, the correct 'verbose' flag state is not making it into this method call.

    Anyway, by the time we get to where the error is printed, an exception has been checked for and not found, result is not >=1. The return value is <0, and I don't think processes are supposed to have negative return values. Wild guess, Process.waitFor() is returning -1 because the process could not be executed.

  16. #16
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    12,380
    If TSET and TyComm were setup it might trigger the IDE build in a different way ? Not sure if the IDE itself it causing the stoppage?

    For a T_4.0 USB=Serial build on a system with IDE and TeensyDuino installed:
    > Save the attached file to a Sketch folder with an INO file as Compile.cmd {remove the .txt extension }
    > With Notepad or other Edit the two paths below that work here to point to 1st the:: ARDUINO install directory and 2nd the:: SKETCHBOOK folder
    set arduino=T:\arduino-1.8.13
    set libs=T:\tCode\libraries
    > Then with File Explorer open double click 'Compile.cmd' - or select and hit Enter.

    >> An MS-Dos box Window should open and compile the sketch and open TeensyLoader - it may require a Button push for upload

    That worked here for :: "T:\arduino-1.8.13\examples\01.Basics\Blink\Blink.ino"

    >> To capture the text in the box if it fails 'use the mouse' - then Ctrl+C to copy.
    >> This can be run one or more times - and if edits are correct - it should always work

    Not sure why this should work when the IDE fails - but work or not it provides full Verbose output. If it works comparing the Verbose output here to the IDE may show the difference.

    Code:
    Attached Batch file - save and take the .txt extension off - edit the paths as noted above:
    
    Compile.cmd..txt

  17. #17
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    12,380
    @Pilot we crossposted while I was watering plants ....

    So then the post #16 trial should work if it is the IDE logic determining FAILURE.

    Question: Is TeensyLoader ( Teensy.exe ) open and ready?

    Not sure what else it .waitFor()'s - but some weeks back - after my machine had been booted some days TeensyLoader would take 15 seconds to appear (rather than quickly <1sec?) and the FIRST build would fail for that.

    Does this happen on a freshly rebooted system?

    As shown in p#16 my system runs on T: drive - (TEMP and Build Source and EXE's) - an SSD where I've told Windows and MalwareBytes to Ignore safety checks for 'Ransome Ware' and the like - with your install in "C:\Program Files (x86)\Arduino\" and default 'TEMP' setup the system (or installed AntiVirus) may be "Protecting" you from Rogue fast writes ...

  18. #18
    Senior Member
    Join Date
    Jul 2020
    Posts
    174
    I modded your code to work with the EchoBoth example:
    Code:
    @echo off
    SETLOCAL DisableDelayedExpansion EnableExtensions
    title TSET Arduino CMD line build
    rem *******************************
    rem Frank Bösing 11/2018
    rem Windows Batch to compile Arduino sketches
    
    rem Usage:
    rem compile.cmd 0 : compile sketch
    rem compile.cmd 1 : compile & upload sketch
    rem compile.cmd 2 : rebuild & upload sketch
    rem - Attention: Place compile.cmd in Sketch folder!
    rem
    rem Edit these paths:
    
    set arduino=C:\Program Files (x86)\Arduino
    set libs=C:\Program Files (x86)\Arduino\libraries
    
    rem *******************************
    rem Set Teensy-specific variables here:
    rem
    
    
    REM defragster was here 
    
    set model=teensy40
    set speed=600
    set opt=o2std
    set usb=serial
    cd.
    set sketchcmd=EchoBoth.pde
    
    rem set keys=de-de
    set keys=en-us
    
    rem *******************************
    rem Don't edit below this line
    rem *******************************
    
    if EXIST %sketchcmd% (
      set sketchname=%sketchcmd%
    ) ELSE for %%i in (*.ino) do set sketchname=%%i
    
    if "%sketchname%"=="" (
      echo No Arduino Sketch found!
      exit 1
    )
    
    set myfolder=.\
    set ino="%myfolder%%sketchname%"
    set temp1="%temp%\\arduino_build_%sketchname%"
    set temp2="%temp%\\arduino_cache_%sketchname%"
    set fqbn=teensy:avr:%model%:usb=%usb%,speed=%speed%,opt=%opt%,keys=%keys%
    
    rem Comment line below to build prior to TeensyDuino 1.50
    if "%model%"=="teensy31" set model=teensy32
    
    if "%1"=="2" (
      echo Temp: %temp1%
      echo Temp: %temp2%
      del /s /q %temp1%>NUL
      del /s /q %temp2%>NUL
      echo Temporary files deleted.
    )
    
    if not exist %temp1% mkdir %temp1%
    if not exist %temp2% mkdir %temp2%
    
    REM if not exist %temp1%\pch mkdir %temp1%\pch
    REM if exist userConfig.h copy userConfig.h %temp1%\pch
    
    echo Building Sketch: %ino%
    "%arduino%\arduino-builder" -verbose=1 -warnings=more -compile -logger=human -hardware "%arduino%\hardware" -hardware "%LOCALAPPDATA%\Arduino15\packages" -tools "%arduino%\tools-builder" -tools "%arduino%\hardware\tools\avr" -tools "%LOCALAPPDATA%\Arduino15\packages" -built-in-libraries "%arduino%\libraries" -libraries "%libs%" -fqbn=%fqbn% -build-path %temp1% -build-cache "%temp2%"  %ino%
    
    pause
    pause
    Output:
    Code:
    Building Sketch: ".\EchoBoth.pde"
    loading hardware from C:\Users\user\AppData\Local\Arduino15\packages: C:\Users\user\AppData\Local\Arduino15\packages is not a directory
    Press any key to continue . . .
    The Arduino15 directory is there, and has some files in it, but no directory called 'packages'. If I take out the -hardware option, it builds everything and makes it all the way to running the Teensy burner (whatever that's called.)

    However, if I run it twice, this is what appears:
    Code:
    Building Sketch: ".\EchoBoth.pde"
    Using board 'teensy40' from platform in folder: C:\Program Files (x86)\Arduino\hardware\teensy\avr
    Using core 'teensy4' from platform in folder: C:\Program Files (x86)\Arduino\hardware\teensy\avr
    Detecting libraries used...
    Press any key to continue . . .
    This is exactly what shows up in the IDE before the error message, and I verified that your script has -verbose=1.

    I could force that method in the Java code to always think verbose is on, but not sure how to compile it or where to put the .jar or whatever the output of that is. If it was printing the command it was trying to execute, it would at least give me something to go on.

    Is there some other way to figure out what it's trying to run?

  19. #19
    Senior Member
    Join Date
    Jul 2020
    Posts
    174
    If I remove the arduino_build_EchoBoth.pde directory from Temp, it rebuilds the whole thing successfully. Removing arduino_cache_EchoBoth.pde (contains an .a file) has no effect.

  20. #20
    Senior Member
    Join Date
    Jul 2020
    Posts
    174
    Alright, I've got something. If I go into Temp\arduino_build_EchoBoth.pde and remove just the includes.cache file, it will rebuild just the example .pde (not the entire core) and the Teensy loader will flash it.

  21. #21
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    12,380
    Hope it helped show something ... Glad it worked at least - bummer it does the same - though that is telling. And something that hasn't happened here in any case building with Windows.

    So something about install there - where install here is just an UNZIP of the IDE to a folder. Maybe you might try an IDE_1.8.13.ZIP download and extract to a folder and install TD 1.53 there and see if it works? I stopped using the IDE Installer long ago because it fought me using 'default' stuff/locations it thought it knew.

    Glad you found the way to force the .PDE file to work - that was in the latest edits to TSET - where it would fail when sketch had multiple INO's in it and the wrong one sorted by name to be the one built

    Yeah the ARDUINO15 tree is only there/populated when other boards are added. That was in the initial stuff by Frank_B so I left it as it worked for me having added a board or two.

  22. #22
    Senior Member
    Join Date
    Jul 2020
    Posts
    174
    I have the IDE installed from a .zip to a different drive and it's still exhibiting the same behavior.

    Is there a command line I can add to that .cmd file to make it automatically flash the Teensy, like it would from the IDE? I have Sublime set up to use that .cmd as a build tool and it would be nice if there wasn't an extra step. If I can get that going, I don't need the IDE at all. (Or its nasty horizontal tabs. Yuck.)

  23. #23
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    12,380
    Quote Originally Posted by Pilot View Post
    I have the IDE installed from a .zip to a different drive and it's still exhibiting the same behavior.

    Is there a command line I can add to that .cmd file to make it automatically flash the Teensy, like it would from the IDE? I have Sublime set up to use that .cmd as a build tool and it would be nice if there wasn't an extra step. If I can get that going, I don't need the IDE at all. (Or its nasty horizontal tabs. Yuck.)
    ZIP not better ... something else odd there ???

    See : github.com/Defragster/Tset

    SUBLIME is perfect - it was designed to well work with that

    When setup - it can use the IDE and SerMon with Teensy.exe to upload - or changing to TyCommander ( my choice for the better ) when integrated replace to provide Sermon and Uploader.

    The ReadMe there links to forum posts that have details - it integrates to SublimeText for editing and building. Has a TSET.cmd to create that Compile.cmd on the fly for any sketch - or Teensy and settings like in the IDE.

    >> Use-Sublime-Text-as-an-Arduino-IDE-replacement?p=245999&viewfull=1#post245999

    Post on that thread or make a github issue if you see anything missing in getting going or room for improvement.

  24. #24
    Senior Member
    Join Date
    Jul 2020
    Posts
    174
    Suppose I just want to use the Build.cmd you sent me, but without having to remove includes.cache.

    This is the content of that file:
    Code:
    [
      {
        "Sourcefile": null,
        "Include": "",
        "Includepath": "D:\\Program Files\\arduino-1.8.13\\hardware\\teensy\\avr\\cores\\teensy4"
      },
      {
        "Sourcefile": "C:\\Users\\User\\AppData\\Local\\Temp\\arduino_build_Project_III.ino\\sketch\\Project_III.ino.cpp",
        "Include": "Wire.h",
        "Includepath": "D:\\Program Files\\arduino-1.8.13\\hardware\\teensy\\avr\\libraries\\Wire"
      },
      {
        "Sourcefile": "C:\\Users\\User\\AppData\\Local\\Temp\\arduino_build_Project_III.ino\\sketch\\Project_III.ino.cpp",
        "Include": "SPI.h",
        "Includepath": "D:\\Program Files\\arduino-1.8.13\\hardware\\teensy\\avr\\libraries\\SPI"
      },
      {
        "Sourcefile": "C:\\Users\\User\\AppData\\Local\\Temp\\arduino_build_Project_III.ino\\sketch\\Project_III.ino.cpp",
        "Include": "EEPROM.h",
        "Includepath": "D:\\Program Files\\arduino-1.8.13\\hardware\\teensy\\avr\\libraries\\EEPROM"
      },
      {
        "Sourcefile": "C:\\Users\\User\\AppData\\Local\\Temp\\arduino_build_Project_III.ino\\sketch\\Project_III.ino.cpp",
        "Include": "OctoWS2811.h",
        "Includepath": "D:\\Program Files\\arduino-1.8.13\\hardware\\teensy\\avr\\libraries\\OctoWS2811"
      },
      {
        "Sourcefile": "C:\\Users\\User\\AppData\\Local\\Temp\\arduino_build_Project_III.ino\\sketch\\Project_III.ino.cpp",
        "Include": "",
        "Includepath": null
      },
      {
        "Sourcefile": "C:\\Users\\User\\AppData\\Local\\Temp\\arduino_build_Project_III.ino\\sketch\\src\\FlashFS\\FlashFS.cpp",
        "Include": "",
        "Includepath": null
      },
      {
        "Sourcefile": "C:\\Users\\User\\AppData\\Local\\Temp\\arduino_build_Project_III.ino\\sketch\\src\\FlashFS\\Tests\\FlashFSTest.cpp",
        "Include": "",
        "Includepath": null
      },
      {
        "Sourcefile": "C:\\Users\\User\\AppData\\Local\\Temp\\arduino_build_Project_III.ino\\sketch\\src\\Input\\Input.cpp",
        "Include": "",
        "Includepath": null
      },
      {
        "Sourcefile": "C:\\Users\\User\\AppData\\Local\\Temp\\arduino_build_Project_III.ino\\sketch\\src\\Kernel\\Kernel.cpp",
        "Include": "TimeLib.h",
        "Includepath": "D:\\Program Files\\arduino-1.8.13\\hardware\\teensy\\avr\\libraries\\Time"
      },
      {
        "Sourcefile": "C:\\Users\\User\\AppData\\Local\\Temp\\arduino_build_Project_III.ino\\sketch\\src\\Kernel\\Kernel.cpp",
        "Include": "",
        "Includepath": null
      },
      {
        "Sourcefile": "C:\\Users\\User\\AppData\\Local\\Temp\\arduino_build_Project_III.ino\\sketch\\src\\Settings\\Settings.cpp",
        "Include": "",
        "Includepath": null
      },
      {
        "Sourcefile": "C:\\Users\\User\\AppData\\Local\\Temp\\arduino_build_Project_III.ino\\sketch\\src\\Time\\TimeTracker.cpp",
        "Include": "",
        "Includepath": null
      },
      {
        "Sourcefile": "C:\\Users\\User\\AppData\\Local\\Temp\\arduino_build_Project_III.ino\\sketch\\src\\View\\NeoPixel.cpp",
        "Include": "",
        "Includepath": null
      },
      {
        "Sourcefile": "C:\\Users\\User\\AppData\\Local\\Temp\\arduino_build_Project_III.ino\\sketch\\src\\View\\NeoPixel_VFX.cpp",
        "Include": "",
        "Includepath": null
      },
      {
        "Sourcefile": "C:\\Users\\User\\AppData\\Local\\Temp\\arduino_build_Project_III.ino\\sketch\\src\\View\\Shader.cpp",
        "Include": "",
        "Includepath": null
      },
      {
        "Sourcefile": "C:\\Users\\User\\AppData\\Local\\Temp\\arduino_build_Project_III.ino\\sketch\\src\\WorldSim\\WorldObject.cpp",
        "Include": "",
        "Includepath": null
      },
      {
        "Sourcefile": "C:\\Users\\User\\AppData\\Local\\Temp\\arduino_build_Project_III.ino\\sketch\\src\\WorldSim\\WorldSim.cpp",
        "Include": "",
        "Includepath": null
      },
      {
        "Sourcefile": "D:\\Program Files\\arduino-1.8.13\\hardware\\teensy\\avr\\libraries\\Wire\\Wire.cpp",
        "Include": "",
        "Includepath": null
      },
      {
        "Sourcefile": "D:\\Program Files\\arduino-1.8.13\\hardware\\teensy\\avr\\libraries\\Wire\\WireIMXRT.cpp",
        "Include": "",
        "Includepath": null
      },
      {
        "Sourcefile": "D:\\Program Files\\arduino-1.8.13\\hardware\\teensy\\avr\\libraries\\Wire\\WireKinetis.cpp",
        "Include": "",
        "Includepath": null
      },
      {
        "Sourcefile": "D:\\Program Files\\arduino-1.8.13\\hardware\\teensy\\avr\\libraries\\Wire\\utility\\twi.c",
        "Include": "",
        "Includepath": null
      },
      {
        "Sourcefile": "D:\\Program Files\\arduino-1.8.13\\hardware\\teensy\\avr\\libraries\\SPI\\SPI.cpp",
        "Include": "",
        "Includepath": null
      },
      {
        "Sourcefile": "D:\\Program Files\\arduino-1.8.13\\hardware\\teensy\\avr\\libraries\\EEPROM\\EEPROM.cpp",
        "Include": "",
        "Includepath": null
      },
      {
        "Sourcefile": "D:\\Program Files\\arduino-1.8.13\\hardware\\teensy\\avr\\libraries\\OctoWS2811\\OctoWS2811.cpp",
        "Include": "",
        "Includepath": null
      },
      {
        "Sourcefile": "D:\\Program Files\\arduino-1.8.13\\hardware\\teensy\\avr\\libraries\\OctoWS2811\\OctoWS2811_imxrt.cpp",
        "Include": "",
        "Includepath": null
      },
      {
        "Sourcefile": "D:\\Program Files\\arduino-1.8.13\\hardware\\teensy\\avr\\libraries\\Time\\DateStrings.cpp",
        "Include": "",
        "Includepath": null
      },
      {
        "Sourcefile": "D:\\Program Files\\arduino-1.8.13\\hardware\\teensy\\avr\\libraries\\Time\\Time.cpp",
        "Include": "",
        "Includepath": null
      }
    ]
    Why is this causing arduino-build to break?

    If I remove that cache, it works fine, but then I have to wait about 15 seconds for it to go through that whole auto-detect thing it does at the start. That is really starting to get old.

  25. #25
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    12,380
    Interesting - not looked in that file before - mine looks similar for the last build here - though not as big:
    Code:
    [
      {
        "Sourcefile": null,
        "Include": "",
        "Includepath": "T:\\arduino-1.8.13\\hardware\\teensy\\avr\\cores\\teensy4"
      },
      {
        "Sourcefile": "T:\\TEMP\\arduino_build_EntropyDiceDuo.ino\\sketch\\EntropyDiceDuo.ino.cpp",
        "Include": "Entropy.h",
        "Includepath": "T:\\arduino-1.8.13\\hardware\\teensy\\avr\\libraries\\Entropy"
      },
      {
        "Sourcefile": "T:\\TEMP\\arduino_build_EntropyDiceDuo.ino\\sketch\\EntropyDiceDuo.ino.cpp",
        "Include": "",
        "Includepath": null
      },
      {
        "Sourcefile": "T:\\arduino-1.8.13\\hardware\\teensy\\avr\\libraries\\Entropy\\Entropy.cpp",
        "Include": "",
        "Includepath": null
      }
    ]
    For clairity - can you note :: OS ver, IDE ver# and TeensyDuino ver#?

    For direct compare the example Blink it looks like:
    Code:
    [
      {
        "Sourcefile": null,
        "Include": "",
        "Includepath": "T:\\arduino-1.8.13\\hardware\\teensy\\avr\\cores\\teensy4"
      },
      {
        "Sourcefile": "T:\\TEMP\\arduino_build_Blink.ino\\sketch\\Blink.ino.cpp",
        "Include": "",
        "Includepath": null
      }
    ]

Posting Permissions

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