Teensey 3.2 Teensey Loader 1.24 Issues

IVO - please read my post #2 - you are running OLD TeensyLoader that may not admit the T_3.2 was coming. If you install a 1.25 or 1.26 build I expect that will change.

Thanks Frank - that confirms my p#22 supposition about USB wait on startup.

I'm still wondering how that relates to failure to upload without needing a Program button?
 
You're still using the old 1.24 version, right? It will always identify both as Teensy 3.1, because it's older than Teensy 3.2.

Update to 1.25 or 1.26-beta and you'll see they're properly identified.

I certainly do appreciate all the feedback, and I absolutely do want to make a better experience for everyone using Windows. But for the sake of improving software, it's much better form to test with the latest beta. This particular timing issue is probably similar in all versions, but testing with an old version risks reproducing and reporting problems that have already been fixed. Please, for the sake of reporting and testing this issue, make another install of 1.26-beta2.
 
Ok, I believe so far for required delays, we have:

100: Direct to PC, Native Windows (unknown version), Frank
2000: USB hub, Native Windows (unknown version), Frank
1000 to 2000, or 2500 (unclear): unknown connection, Virtual Machine Win7-64 hosted on Win8-64, Ivo

Did I miss any others?
 
How about implementing something simple like including "dev" library that has the relevant variables and users can comment out the lib for final product.

We're just a few days away (hopefully just a few days) from a final 1.26 release. The only practical thing to do in such a short time is increase the fixed delay. Perhaps for 1.27 or later, some other scheme might be possible. But my general goal is 3 to 4 releases per year, so unless Arduino drives us to make an early release, everybody's going to have to live with whatever extra delay we add for 1.26 for at least a few months!
 
@defragster: different issues... my main problem is strange behavior with the arduino serial monitor - sometimes it does not recognize the re-appearing serial device (or perhaps win10 has a problem ?) This behavoir *seems* to be away with delay(100).
- i just tried to add a mouse to my "DELL" hub. same issue. sometime works, sometimes not. i declare my "DELL-Display-Hub" as broken now, and don't do any more tests with it, since it is not a teensy-specific problem.
 
Nothing from me. I just changed to Beta_2 and held off the edit - and after 14 IDE UPLOADS I'm 100% good unchanged.

I tried to do 10 quick UPLOADS with no code change and ran into the 'Automatic Mode Disable'. I acknowledged that and finished and up to #25 no problem with the default delay(4).

//delay(100); // TODO: this is not necessary, right?
delay(4);
 
FWIW, I do most of my development on Linux 64 through a hub which Linux identifies as "Terminus Technology Inc. FE 2.1 7-port Hub". It always works flawlessly with the 4 ms delay.
 
NOTE: Last night when I went form T_3.1 to T_3.2 I started a new IDE SerMon. Later I noticed it abandoned an OLD SerMon window. That has not re-appeared. It had no "COM" id , so I assume it was associated with the T_3.1 and the IDE lost track of it. I have not rebooted or done anything unique except shut down IDE 1.6.5 and Teensy to get 1.26b2.
 
Seems like we're getting at least a few people per week with the "Teensy doesn't boot up automatically" problem, which turns out to be their code tried to initialize a I2C sensor or some other chip before it was ready. My guess is quite a lot of Windows users might be seeing occasional problem and not reporting them, because it only happens once every dozen or two uploads.

So I'm feeling inclined to try a longer delay for 1.26. How long is the question?
 
all i can say is, that for my specific setup - and i tested this evening only - something around 100ms are good.
but do you remember users who need a short bootup-time ? there was a guy who needed fast startup for a automotive "blink"

i know, it is not the time for such suggestions, but i think, arduino lacks a way for sketch-specific settings. really.
something like a simplified makefile or just a specific textfile with #defines in the sketch-folder that are valid for every compiled file.
you could specify the optimizations, cpu-freqs, or disable serial 1,2,3.... per sketch.
and you could #define your pins - for example - for displays, audio-outputs and so on...


edit:...and you could just add a line "#define FAST_START 1" :)
 
Last edited:
Too many examples have the bad "while(!serial);", or more harmlessly "//while(!serial);". I just found 30 threads hitting on qBlink() - my "power the LED on startup and wait some time for serial to come online" simple blink sketch. About as often as I2C devices get rushed to start - folks don't have proper pull-ups. The Wiki or a good intro text could fill in those gaps since they can be covered.

Is that a separate issue to where I thought this thread started?

I'm up over 33 UPLOADS from the IDE with SerMon open and not triggered the T_3.2 'push program' yet this time after 14 last time.

Speaking of qBlink example - I just cleaned one to this - it prints NOTHING on the IDE SerMon - even though it waits up to 4 seconds for Serial? unless you uncomment the print"." in the loop()? Then the expected output shows up including 984 to 1100 on millis() through the IDE SerMon. Closing that and using TYQT the number is 258 to 294 with 6 resets. This simple sample just showed another issue, following.

Note - using TYQT ( I said I wouldn't but ... for this test ) - TYQT cannot cause a BOOTLOADER update on the brand new OSH T_3.2! TYQT (most) always works to reboot - now it sees the device in some odd state, though can send a reset. I get this in the 1.26b2 Verbose - one of the other oddities I've posted - this hit from 6 weeks back and was on T_3.1's. This persists even after repeated BUTTON hits, and the Teensy is OFFLINE/ASLEEP (no Blink) it is awaiting programming. Though TYQT can send a RESET to restart it with the old code.:
17:26:19: Device came online, code_size = 262144
17:26:19: Board is: Teensy 3.2 (MK20DX256), version 1.03
17:26:19: File "qBlinkWait.cpp.hex". 16368 bytes, 6% used
17:26:19: HID/win32: HidD_GetPreparsedData ok, device still online :)

I've closed TYQT and still a BUTTON just freezes the Teensy - and TLoader Verbose is the same: "17:34:45: HID/win32: HidD_GetPreparsedData ok, device still online :)".

TYQT Closed and I swapped the T_3.2 for a T_3.1 that has been active for days - plug it in and hit BUTTON and the same result. It was running Touch_ILI9341 code I suspect as the LED glows hitting SPI. I did a power off cycle and this behavior persists. This is usually when I closed TLoader, hit Verify in the IDE and all is well. I 'think' I hit verify - but when TLoader opened it went direct to Program and put qBlink over my TOUCH code. Back to T_3,2 and it is working again.

Anyhow - more questions than answers - this is the odd behavior I've been seeing show up on occasion and took some learning to figure out how to extricate and return the system to function. And this is not related to delay() before setup() AFAIK. I rely on TYQT for my multi Teensy fun - it makes Teensy even better and without it SerMon would not serve my purposes as it can only open one Teensy monitor window - and TYQT adds BOOTLOAD/UPLOAD and RESET that are needed things (versus repowering or button pushing). This is not normal behavior.

BACK TO Serial.print() - the behavior above repeats - without the "// Serial.print(".");" in loop() I get NO SerMon output! It is waiting for some event. Okay so I put the change in pins_teensy.c " delay(2100); // TODO: this is not necessary, right?" and it now displays about 50% of the time. and the millis number was 2400+. Taking the ".c" delay to 2500 still gives no USB 50% of the time. The problem is the SerMon, as TYQT was working with delay of (4) alone and showing up at under 900 typically. When I uncomment the print in loop() IDE SerMon works 100% at number 1000-1160 millis. The SerMon is not pushing the data it gets waiting for some event, even adding this to setup() " Serial.println("abcdefghijklmnopqrstuvwxyz");" does not prompt any USB data display three out of three times, unless I uncomment out the loop() print, the all the output shows with the FIRST '.' from loop().

Code:
#define qBlink() (digitalWriteFast(LED_BUILTIN, !digitalReadFast(LED_BUILTIN) ))  // Pin13 on T3.x & LC
void setup() {
  Serial.begin(38400);
  digitalWrite(LED_BUILTIN, HIGH);
  pinMode(LED_BUILTIN, OUTPUT);
  qBlink();
  delay(200);
  while (!Serial && (millis() <= 4000))
    qBlink();
  Serial.println(millis());
  Serial.println("OK");
}

elapsedMillis emilBlink;
void loop() {
  if ( emilBlink > 1000 ) {
    qBlink();
    emilBlink = 0;
    // Serial.print(".");
  }
}
 
Last edited:
I put "delay(400); // TODO: this is not necessary, right?" in the .c file and I get 2 out of 6 usable IDE SerMon sessions on my qBlink above without the loop() print'.'.

You can put in (400) to affect the symptom - (2500) might wholly hide the symptom - my thoughts on the problem follow:

Note this is on a T_3.1 now ( I finished post #40 on a T_3.2 ) - so this doesn't seem to be specific to one of them.

It seems the (400) is a 33% improvement - Going back to 2,500 I get about 100% startup on that qBlink as posted #40 (except I left this line " Serial.println("abcdefghijklmnopqrstuvwxyz");" in setup() after print"OK".

Dropping to (2000) I still get about 50% misses.

Returning to TYQT it is 100% perfect the USB is there and it catches all output - but I have to hit PROGRAM since TYQT holds the USB open.

With only (4) in the .c, and removing the delay(200) from qBlink setup() TYQT responds and mostly picks up in under 300 millis(). The problem is not Windows, it is the IDE SerMon - on Windows. Note - If you Upload a device with SerMon closed - then open SerMon on my qBlink it prints near these values depending on where you catch it on restart
// FROM IDE SerMon just after programming is done
3082
OK
3291
OK
1603
OK
, Again I think this came about in the IDE at or after ver 1.6.3. I started on Teensy the DAY that Beta was released for the 1.6.x family and it went downhill one build.

// FROM TYQT
283
OK
281
OK
277
OK
288
OK
286
OK
312
OK
 
Just went to my IDE 1.6.3 dir that has 1.24b3 and it acts the same way on the T_3.1 (and T_3.2).

15 out of 15 it works As soon as the loop() prints the first '.' the USB is alive and includes Millis that where 765 to 991 or less with preceding qBlink sketch.

I don't see a problem of the Teensy boot timing - just the event or processing within the SerMon code after backing down for the Upload to pass through - it connects but not fully active until ???


Here is how I saw the ODD problem where SerMon has a weird association with the USB - swapped T_3.1 (com25) for T_3.2(com3). I closed #25 to open #3 and when I did - long after the T_3.2 was booted here is the USB output that came up - it was somehow there just as the while !Serial gave up?:


<edit> Just restarted IDE and it worked 8 out of 10 times with no extra .c delay and no loop print of '.'.
 
Last edited:
I allow to throw in my two cents since I'm having serial monitor timing issues, too, but with the Arduino Eclipse IDE, where I get most times an error message about the serial port not being present after uploading code into the Teensy 3.x.
I found out that I can reproduce it with the following test code:
Code:
void setup(){
Serial.begin(57600);
delay(1000); //whatever delay from 0 to 10000 will not change the problem
while(!Serial); 
//do something}
The strange thing is that when I add a short delay BEFORE Serial.begin(), there is no more timing issue:
Code:
void setup(){
delay(10);
Serial.begin(57600);
while(!Serial); 
//do something}
I'm not sure if that info is helpful in this context, especially since I didn't expect Serial.begin() to address the com port actively, but I thought that it could perhaps add to the picture.
 
Paul: Does anything happen on exit of setup() before it starts loop() that would explain why the "Serial.print(".");" makes it connect and display all prior data?

Thanks for trying on a different monitor @Theremingenieur. Does the Eclipse tie into the IDE to drop USB to allow upload like SerMon? TYQT does not. I have MegunoLink_Pro - I got it to connect once after an update - but need to try it's IDE hooking.

That added delay should/would have the same effect as a longer delay in the pin__.c file as setup() follows that delay. I always expected moving the Serial.begin to the top was ideal - maybe it isn't. But small delay and doing qBlink pin set first had no effect.

With that delay(10) {or some larger} at setup() start in my qBlink and got 1 success in 6 - the first one. If I do the loop() print('.') I get perfect success - with or without that on IDE_SerMon.

My current TOUCH_9341 sketch first print is working perfectly with SerMon and no delay's . . . though when I got this starter it failed to "Serial.println("Touchscreen started.");" until I tweaked the while()?
 
Isn't Serial.begin(..) a empty function and does nothing ? Or has this changed ?
Hm,knowing that T31/T32 are the same regarding software, i would think that for MY serialmonitor issues windows10 changed something..
I hav'nt had the serial monitor "problem" with Win7. Maybe the easiest answer is, that Win10 is simply slower than win7 ? :) (too much "phone home" :confused:)
Strange.
 
Last edited:
<edit>: of course this points to UART serial1 not USB . . .

I:\Teensy165\hardware\teensy\avr\cores\teensy3\serial1.c looks pretty non-empty to me at line 105?::
void serial_begin(uint32_t divisor)
{
SIM_SCGC4 |= SIM_SCGC4_UART0; // turn on clock, TODO: use bitband
. . . .
 
Last edited:
The Eclipse Arduino plugin seems to take stuff from the Arduino IDE to manage the upload:
/Applications/Arduino.app/Contents/Java/hardware/tools/teensy_post_compile -file=dVoxUniCore -path=/Users/thierryfrenkel/Documents/ArduinoEclipse/dVoxUniCore/Release -tools=/Applications/Arduino.app/Contents/Java/hardware/tools -board=TEENSY31 -reboot
Which, as far as I understand, launches the Teensy uploader.
It is true that none of these obvious timing problems show up when I use TyQt to upload the .hex file. There, everything is smooth, code uploads, Teensy reboots, and everything shows immediately up in the TyQt Serial monitor.
 
FrankB - Of course it is . . . you are correct - I searched and lost track of my parameters. usb_serial.h has::
void begin(long) { /* TODO: call a function that tries to wait for enumeration */ };

Theremingenieur - you have /'d path - is that linux or mac?
TYQT Rocks - puts SerMon to shame and the added hex upload without re-compile and the GUI reset and 'multi Teensy GUI directed upload' just puts some great icing on the cake that is Teensy. If it tied into "Upload Drop USB on Com#" to auto direct the flash it would be worth twice the price!
 
I'm on Mac:
Capture d’écran 2015-11-05 à 10.41.30.png
 
Back
Top