Unable to find Teensy Loader and similar errors, especially on Linux

Status
Not open for further replies.

PaulStoffregen

Well-known member
Please let me know if you've been seeing this error occasionally & randomly appear when uploading? Sometimes Arduino can't upload, but usually the upload works (perhaps slightly delayed) despite the error appearing in Arduino's message window.

It seems to occur infrequently and isn't always easy to reproduce. Seems to be getting worse on recently updated Linux systems.

If this is happening on your system, please reply and let me know which operating system & version you're using, which desktop (if Linux) and approximately your computer's specs (such as: grep "model name" /proc/cpuinfo).

Please also stay subscribed to this thread. I'm working on this issue now. Since it's so intermittent, I could really use your help with testing (hopefully) fixed files on your machine. I want to fix this elusive bug once and for all.
 
Last edited:
Here's my first attempt at a fix for this elusive, long-standing bug. All signs point to communication between Arduino and Teensy Loader getting out of sync. I've redesigned that code, hopefully to make this far more robust.

To use this, extract the zip file and grab the 2 files from the directory matching your operating system. They go into Arduino's hardware/tools folder (replacing the copies already there). On a Mac, control-click and use "show package contents" to access Arduino's folders & files, and then navigate to Contents/Java/hardware/tools.

If these problems happen regularly on your computer when uploading to Teensy, please give these a try and let me know if they solve the problem. This happens so infrequently on every computer I use for testing, so it's really difficult to know if anything I try is really effective. Please help me figure out if this fix is really working?
 

Attachments

  • sync_test.zip
    82.9 KB · Views: 153
Hmmm, maybe this problem is quite rare? If anyone's experiencing this issue, please speak up...

Sorry, I usually use the modified cli, so I have no experienced the problems you try to solve.
However, I realized that on Windows, the response times of a teensy is noticeable (in the order of seconds).
(response time is time to realize that teensy changed status)
Also, every time I plug in a T3.6 and start programming and also frequently during SW development, I have to dis- and re-connect my hub, then press the button, so that programming continues.
But this may be another issue, most likely with my handling of the USB port, but is very consistent, so I got used to it.
 
Last edited:
I have been using Ubuntu 14.04 (32-bit) for several years on desktop and laptops and have NOT experienced the problem. I've been running some on 16.04 (32 and 64-bit) for the last few months and have NOT experienced the problem. No problems on MAC OS (limited use).
 
I've seen this on my macbook pro 10.9.5, I'll keep me my eyes peeled and report back on the details here when it happens again.
 
Using Windows 7, the only weirdness I've run into lately (yesterday) is that the IDE reported twice that it could see COM26 but couldn't communicate with the Teensy - I haven't seen that before. Unfortunately, I forget the exact details of the message. I'll keep an eye out for it.

Pete
 
It seemed like something I've seen - but it never persists beyond another IDE_COMPILE or doesn't happen often enough to be a bother or repro enough to look after. Also I'm on Windows 10 and generally use TYQT integrated. TYQT gets a 'similar?' IDE note of failure - I just worked through it - perhaps a TYQT GUI hit on bootloader or reset as needed.

Only thing I've seen recently is expected as USB of course not always being responsive when I did a WFI sleep sketch with hsrun dropping to 120 MHz over the WFI. It may emulate the problem - but I haven't bothered to read the messages as it was caused by my sketch'y behavior.
 
I'm not sure if this is what you are talking about but this happens fairly regularly is that I have to click the focus off the Arduino IDE to get the teensy loader to upload. It gives me this error:
Sketch uses 11,808 bytes (4%) of program storage space. Maximum is 262,144 bytes.
Global variables use 9,208 bytes (14%) of dynamic memory, leaving 56,328 bytes for local variables. Maximum is 65,536 bytes.
Teensy did not respond to a USB-based request to automatically reboot.
Please press the PROGRAM MODE BUTTON on your Teensy to upload your sketch.

Sometimes it will upload anyway after that error but sometimes not if I don't refocus on some other application or what I usually do is just bring the mouse down to bring up the DOCK. I can do a screen cast video if that would help. This error just happened as I'm typing this up.
Using Mac OSX 10.9.5 and Any Arduino or Teensyduino and I have not updated the IDE with your fix yet.

Edit... Just applied your patch to IDE 1.6.13, I'll report back on any odd behavior related to this.
 
Last edited:
I am new to Teensy, and have had problems related to Arduino IDE-Teensy Loader communications. Your new Sync-Test files have, so far, solved this. More detail:

After receiving the T3.6 and Audio board last week, I got everything working fine, including compile and load. This was on XP. Next I wanted to do this on Lubuntu 14.04 on an Intel(R) Core(TM) i7-4790 CPU @ 3.60GHz. Problems. I tried 8 or 10 verify and compiles, and almost every time would get a failure with detail, "Error reading Teensy Loader status! (tpc)This error should never happen (when using Arduino). Please report this to paul@pjrc.com." On one try only, it was OK, and I could proceed to a manual reset and load, or using the Arduino Sketch/Upload; all was working. At that time I could also see the file /dev/ttyACM0, that otherwise never was there. After that, if I recompiled, the error was back.

So, I replaced the two files with your Linux 64-bit ones, and since then everything has been fine. All Verify/Compile/Upload/etc functions work repeatedly without error. And, ttyACM0 is there every time I look.

Now the tricky part: I had saved the old files by modifying their names. For fun, I closed Arduino and the Loader, restored the two old files, reloaded Arduino and repeated the test. So far no error!!! As viewed from here, it appears that some configuration setting or other sticky element was changed. I cannot repeat the problem. I should think that reloading all programs would restore the issue, but that won't happen without a strong scientific need!

Good luck, I hope this helps. Bob
 
What I observed sometimes in OSX is that the upload seems to hang when the Teensy loader window does not have the focus or is not in the foreground. But the upload always continues if I manage to bring the window to front with the option+tab keys before a timeout occurs.
 
An Update: Paul, I have been using the Arduino IDE + Teensy quite intensely since my post 3 days ago, with hundreds of compiles and loads. Not one sign of a problem! Before your sync_test update, the two pieces would not work together.

A sample of one... Bob
 
sometimes in OSX is that the upload seems to hang when the Teensy loader window does not have the focus or is not in the foreground.

Any chance you could save the 2 log files next time this happens? Or even if 1.33 fixes the problem, if you notice substantial slowness, please save the logs. The other log is written to /tmp, so you'll need to type something like "mv /tmpteensy_reboot_log.txt ~/Documents" in Terminal to make it accessible.

The new version logs everything on both the Arduino side and Teensy Loader side, with 1 ms precision. At the moment I've been working just to solve long-standing issues, but eventually I want to really optimize the little delays we currently suffer before and after the speedy uploading, which ultimately lengthen the total time from clicking upload in Arduino to when Teensy is really running the new code.
 
Any chance you could save the 2 log files next time this happens? Or even if 1.33 fixes the problem, if you notice substantial slowness, please save the logs. The other log is written to /tmp, so you'll need to type something like "mv /tmpteensy_reboot_log.txt ~/Documents" in Terminal to make it accessible.

The new version logs everything on both the Arduino side and Teensy Loader side, with 1 ms precision. At the moment I've been working just to solve long-standing issues, but eventually I want to really optimize the little delays we currently suffer before and after the speedy uploading, which ultimately lengthen the total time from clicking upload in Arduino to when Teensy is really running the new code.

I'll try that from this weekend on. The last weeks have been very busy for me (my not Teensy related day job and some concerts to prepare and to play on top), so I couldn't advance much on my current T3.6 project. But I decided and prepared already to modify the code I started writing on the T3.2 with lots of integer math to work with floats using the dedicated FPU instructions on the T3.6.
 
Status
Not open for further replies.
Back
Top