Teensy Loader problems

Status
Not open for further replies.

sumotoy

Well-known member
Hi guys,
after very long time it's nice to be here again and say hello to everybody using my hands again.
after long time and long disease I finally get out, only sad for lost my mother in maintime... but I'm well and my wife and son perfect so I'm happy, really.

Anyway, I was freaking out to continue play with Teensy's (expecially new ones), I left everithing around end of April last year and
almost disappeared from the entire web till now.
I decided to buy a new computer and notebook for the big event, both Intel Win 10, brand new and with latest win 10/64.

Installed arduino 1.8.2

Installed Teensyduino 1.36

Connected a Teensy 3.2, it installed driver as usual, upped blink, pressed the reset and Teensy Loader correctly upped (and driver updated).
On Arduino IDE Teensy serial appear as COM 8 (Teensy)
I changed delay in blink program and upped again, IDE says 'Done uploading', Teensy Loader verbose as follow:
'
00:03:10.633: remote connection opened
00:03:10.634: remote cmd: "comment: Teensyduino 1.36 - WINDOWS (teensy_post_compile)"
00:03:10.634: remote cmd: "status"
00:03:10.634: status data sent
00:03:10.634: remote cmd: "dir:C:\Users\UNCINE~1\AppData\Local\Temp\arduino_build_620849\"
00:03:10.635: remote cmd: "file:Blink.ino.hex"
00:03:10.638: File "Blink.ino.hex". 14464 bytes, 6% used
00:03:10.644: remote cmd: "status"
00:03:10.644: status data sent
00:03:10.655: remote connection closed
00:03:10.717: remote connection opened
00:03:10.717: remote cmd: "comment: Teensyduino 1.36 - WINDOWS (teensy_post_compile)"
00:03:10.717: remote cmd: "status"
00:03:10.717: status data sent
00:03:10.717: remote cmd: "dir:C:\Users\UNCINE~1\AppData\Local\Temp\arduino_build_620849\"
00:03:10.717: remote cmd: "file:Blink.ino.hex"
00:03:10.717: File "Blink.ino.hex". 14464 bytes, 6% used
00:03:10.727: remote cmd: "status"
00:03:10.727: status data sent
00:03:10.747: remote connection closed
00:03:14.397: Verbose Info event
'
Looks everything good but... it doesn't up anything!!!
If I remember well, it should reboot but this not happen and the program bar doesn't appear, it works only if I manually press 'reset' button on Teensy.
I tried give full access to Arduino IDE and Teensy Loader in Winwos Firewall (I don't use any antivirus on both computer),
tried give Admin privileges to Arduino IDE and all Teensyduino programs, nothing, I have to manually press reset every time, really annoying.
Tried with 5 different Teensy 3.2 and 2 x Teensy 3.6, same thing.
Ok, maybe it's the computer? Tried on notebook and was very surprised, same results.
Oh, well, time to read troubleshooting page but appear all ok, I'm using Teensy from the very firs time and never a problem.
Another strange thing, I have turned off the AUTO button on Teensy Loader, in verbose appear 'Auto mode: disabled', but upping a sketch cause the button enabled itself again and doesn't stay off, weird on verbose this not appear.
Just to be sure, I've changed the cable a couple of times, nothing changed. My computers uses almost USB 3.0 or 3.1 only, can be that (stupid question, how can be?) ?
I have missed something? This is my first question, any suggestion to get it work as it should?

For second question, I have noticed the new Optimize menu on IDE, I know it will take eons to talk about what changed and I'm not asking a detailed explain but some library doesn't work or work really bad (data returned is bad, I'm sure it's something related to variable and declarations that should be volatile, etc),
I'm just asking witch is the 'legacy' optimization used until last year, by default IDE goes to 'fastest' but I'm sure it's not the legacy one.
Thanks in advance for help guys nice to be here and thanks for the amount of massive work to everyone, Teensy rocks!
 
Hi and welcome back! Glad you are doing better.

Not sure what is going on with your T3.2. NOt sure about installing Driver? On Windows 10, it typically no longer needs to install the driver like I used to have to do for Windows 8 or 7.

I would probably go through the normal debugging stuff and/or convert over to TyQt (Now TyCommander) to do the dowloads and serial ports (https://github.com/Koromix/tytools)

Yes with the most the latest version of Teensyduino the compiler tool chain was updated. The optimize menu allows you to choose through different options. The default one being the first one in the menu, which is different for T3.x boards versus T-LC On my T3.6 default is Faster, which translates to:
Faster -> -O2
Fast -> -O1
Fastest -> -O3
Smallest Code ->-Os

The LTO translates to: -flto -fno-fat-lto-objects

But as mentioned in the thread: https://forum.pjrc.com/threads/43811-Speed-test-and-optimizations-some-surprises!

Fastest is not always the Fastest...

Also as you mentioned sometimes the compiler optimizations will screw up some programs... I have run into a few instances where something was not acting right and trying a different setting helped. In most cases I found ways to remove the issues.

Sorry I know I did not help much here, but again Welcome Back!
 
Great to see you back sumotoy! To Echo KurtE - welcome back - Win 10 working well for me - uses native driver with no added install. Do you have a USB (2) hub around? On startup to get Serial online a USB 2.0 hub connects (IIRC 100+ms) faster on my machine - perhaps your machine/driver has some new 'support/feature' that is getting in the way.

Give TyCommander a try : koromix/tytools/tytools/view#files
> Click the FILES and the UPDATED column to get the newest to the top currently I see : TyTools-0.8.0-177-gf985121-win64.zip
Extract 'someplace' unblock the Tycommander.exe and give it a run. Optionally and ideally close the IDE and TeensyLoader.exe and then Tools/ Integrate to Arduino. Then open the IDE and it will be there to seamlessly upload and run as SerMon.

Also KurtE started this thread Use-Sublime-Text-as-an-Arduino-IDE-replacement - that led me to SublimeText as a great editor and more efficient IDE interface that might help minimize your keyboarding as Sublime has some great Global Grep/Search features that help navigating the whole of the Teensy source tree - or your own source directories.
 
I upgraded one of my win10 systems to the newest version a couple of days ago. Since then the automatic upload via Arduino didn't work anymore. CLI works. But: I didn't test it systematically yet, might be something on my side.
 
Welcome Back!

Not sure what's up with Windows 10. I'm traveling right now, so can't do much to test until I return in ~2 weeks. I mostly use Linux, so I haven't done much with Windows since the last release a couple months ago. Maybe a very recent update on Windows has broken something?

Another strange thing, I have turned off the AUTO button on Teensy Loader, in verbose appear 'Auto mode: disabled', but upping a sketch cause the button enabled itself again and doesn't stay off, weird on verbose this not appear.

At least that part is normal. The way Arduino does the upload involves telling Teensy Loader the freshly compiled file name and turning on auto mode. Then it runs the teensy_reboot utility that tries to find a Teensy and send it a request to reboot. When it does, the upload happens by Teensy Loader because it's been placed in auto mode, so Teensy Loader does the programming as soon as the Teensy reboots into bootloader mode.

For second question, I have noticed the new Optimize menu on IDE, ...
I'm just asking witch is the 'legacy' optimization used until last year, by default IDE goes to 'fastest' but I'm sure it's not the legacy one.

Fast (gcc -O1) corresponds to the old default on Teensy 3.x, which was "optimized" in the CPU Speed menu. Smallest Code (gcc -Os) is the old default for Teensy LC, and the other option that used to be available in the CPU Speed menu.

Fastest (gcc -O3) and LTO break some programs. That's why they're not (yet) the default setting, even though they can make pretty substantial improvements to some programs. It's very likely some parts of the core library may be missing volatile or asm memory barriers or other subtle things that never mattered before. Several libs may also need small updates.

Teensyduino 1.36 updated the toolchain from gcc 4.8 to gcc 5.4, and a newer version of the newlib C library. I had been putting this change off for quite some time (years), staying with the 5 year old toolchain during development and the release of Teensy 3.5 and 3.6. FWIW, Arduino still uses a slightly even older toolchain for all their 32 bit ARM boards. Finally the time came to upgrade, so we can have newer features and improvements from the last 5 years of toolchain development. For the most part it's gone pretty well, but we're still discovering some things the new toolchain breaks.
 
I noticed this problem too (newly updated Win10, LC, 3.2 & 3.5). Running teensy_reboot.exe manually seems to work ok - it reboots & reprogram the teensy with the latest build.
I use another Win7 computer that doesn't have this issue, which seems to confirm that this issue is cause by the recent Windows10 update

Marc
 
@Sumotoy - welcome back - Just crashing this thread to say I am happily using your GPIO Expander library for MCP23S17. very nice.
 
Just FYI -- Another data point...

I also now have to push the "reset" button on my Teensy 3.1 and 3.2 to get the Teensy Loader to load new firmware.

This issue has recently appeared as the Teensy Loader has worked reliably in the past.

Recent Changes:
Windows 10 Upgraded to most recent release - Windows 10 Pro 64 bit - Version 1703
Arduino 1.8.2
Teensy Loader 1.36

Test Program is the BLINK Example.

If I change from using the Teensy Loader to TyQt 0.8.0 then the autoupload of new firmware works as expected.
 
Thanks guys, happy to be here alive and kicking again, missed all :)
I think this issue is related to the infamous Windows 10 Creators Update ? I have another notebook still running legacy Win 10 and works without reset as it should.
I'm try to find a link where explain Windows 10 Creators Update changes, as far I know is still not official and user have to trigger it manually (by insider program or by this:
https://support.microsoft.com/en-us/help/3159635/windows-10-update-assistant
Unfortunatly I have already patched my Win 10, the update works ok and I have no issues (apart this one, sigh) and I cannot go back, looks like this upgrade created several issues and I have tried some workaround but none worked.
 
TyTools solved the problem, at list with Arduino IDE, will try on Visual Studio in minutes.
I didn't know about this tool, very cool!.
 
I have the same issue after upgrading to "Windows 10 Creators Update". Before the Windows update the Teensy auto upload worked as expected. Now one hour later with the update installed, auto upload doesn't do anything and I have to manually press the program button each time.
 
Quick update: I actually have this issue as well. With my newer HP desktop.
It is working fine when I connect the USB directly to one of the USB ports on the PC...
However it was not working well, when I had a USB 2 multi TT HUB plugged in (https://www.amazon.com/gp/product/B004Y35DRE/ref=oh_aui_detailpage_o09_s00?ie=UTF8&psc=1)

It might talk for a little, but then if I try to program it, it will fail and then get errors talking...

So just now tried using different HUB, which is an cheap USB 3 hub: https://www.amazon.com/gp/product/B00UMVFJW6/ref=oh_aui_detailpage_o00_s00?ie=UTF8&psc=1

On my machine It appears like all of the USB connections go through:
Code:
    Intel(R) USB 3.0 eXtensible Host Controller - 1.0 Microsoft 
        USB Root HUb (USB 3.0)
            Generic USB Hub   (this is the one I just plugged in)
                USB Serial Device(COM15)      (This is the T3.6 I plugged into the new hub)
            Saleae Logic Pro 8 USB Logic Analyzer   (Saleae Pro plugged in using USB 3 cable)
            USB Serial Device (Com14)        (This is the cable that always appears to succeed)

I did some quick looking around and it appears like there may be some other USB issues with this release. Although they sounded more likely on older machines.
There were some places like: http://www.drivethelife.com/windows...ng-recognized-windows-10-creators-update.html
That gives a few things to try. So far I have not done this as hopefully this different HUB will take care of my issues, until they issue an update
 
Some legacy stuff was cut off and who knows what else went with that.

Got a call the other day that led me to this when a guy got the 1703 'Creators Update'. I don't suggest there is anything here to help - just a note that stuff was changed:
Windows Mobile Device Center will not be supported in future versions on Windows 10

Update:* The official Microsoft position has not changed and support for WMDC ended in 2012. ...

While it did work OK with earlier versions of Windows 10, it seems that a change in 1703 has been fatal.

This guy puts out water pump monitoring devices that have worked for transfer on WMDC for years and stopped - it did work for him after a fresh boot - so not broken - just altered???
 
Yes.

Windows 10 Creators Update (Build 15063) / Arduino 1.8.1 / Teensyduino 1.36
 
Last edited:
I'm installing the creators update now.... (it's a long process, apparently)

It will be basically a full OS Re-install and then Upgrade tweaks to account for changes to settings . . . . It hasn't hit any of my machines yet - though I did download the ISO for a disk install if I get ambitious . . .
 
Got 1703 installed, then spent the day documented the Maker Faire project. Going to take a little vacation time, so I probably won't get to work with this until I return next week.
 
I've found that my 3.2 programs fine from the Arduino IDE in Verbose mode under the new Win 10.

Otherwise it needs to have a"button push".

Considering the number of status requests generated before there's a response, my guess is that Verbose is slowing things down just enough to make it work!

Hope this helps in the debugging.
 
Here's a possible fix. Please give this a try and let me know if it works on your Windows 10 system?

Extract this to Arduino's hardware/tools folder, replacing the existing teensy_post_compile.exe.
 

Attachments

  • teensy_post_compile.zip
    10.8 KB · Views: 238
my guess is that Verbose is slowing things down just enough to make it work!

FWIW, it was working about 1 in 4 tries on my test machine, even without verbose mode.

With the fix it works every time, at least on my machine, on a few dozen uploads I tried. Obviously there's something slightly different between machines. I don't personally use Windows much, so my test machine is a very minimal setup, not a well used Windows system with lots of software installed and lots of cruft accumulated in the registry and all sorts of other places as Windows tends to do over time.

So I'm really depending on feedback from everyone running Windows.

In case anyone's interested, teensy_post_compile.exe runs teensy_reboot.exe, if given the "-reboot" flag, which happens when you click Upload rather than Verify. I build with MinGW and I was using MinGW's execl() function (which means I can use the same code for Mac, Linux & Windows). Apparently something about 1703 breaks it. I just rewrote that code to use WIN32 ShellExecute(), which seems to solve the problem. I'm guessing this was just some subtle bug in how MinGW implements execl.
 
Windows 10 Creators Update / Arduino 1.8.1 / Teensyduino 1.36 with the new teensy_post_compile.exe: it works.

Windows 10 Creators Update / Arduino 1.6.5 / Teensyduino 1.26 beta1 with the old teensy_post_compile.exe: compiles, auto upload doesn't work
Windows 10 Creators Update / Arduino 1.6.5 / Teensyduino 1.26 beta1 with the new teensy_post_compile.exe: complains about
Found Teensy Loader version 1.26, but the minimum required is 1.33.
Please use File > Quit in Teensy Loader. The new version
will open automatically on your next Verify or Upload.
Opening Teensy Loader...
Error compiling
(code is the Blink example)
 
Windows 10 Creators Update / Arduino 1.8.2 / Teensyduino 1.36 with the new teensy_post_compile.exe: it works.
 
Windows 10 Creators Update / Arduino 1.6.5 / Teensyduino 1.26 beta1 with the old teensy_post_compile.exe: compiles, auto upload doesn't work

Yes, this is correct behavior. The communication protocol between teensy_post_compile (command line) and Teensy Loader (gui) changed with version 1.33. The new version of teensy_post_compile is supposed to detect if it's communicating with an incompatible version.

Yeah, with more work I could design these programs to be backwards compatible with each other. But that's just extra unnecessary work for a set of tools that are intended to always be delivered together by the same installer. I already put a *ton* of work into backwards compatibility for several Arduino versions and many libraries, so I'm not eager to pile on even more where it's never really needed. Instead these utilities do a simple version check and give you an error message, rather than hanging or strange wrong behavior.
 
Status
Not open for further replies.
Back
Top