Teensyduino 1.18 Release Candidate #2 Available

Status
Not open for further replies.

Paul

Administrator
Staff member
Here is a second release candidate for Teensyduino 1.18.


Old beta download links removed. Please use the latest version:
https://www.pjrc.com/teensy/td_download.html



Please give this a try and report any bugs. Try to include a sample program that reproduces the problem!


Here's a list of the changes since Teensyduino 1.18-rc1:

  • Speed up SD library
  • Fix upload > 128k on Teensy 3.1
 
Serial.available() bug in 1.18 RC2

Serial.available() seems to have a bug.

If you do a Serial.read() with no data available, read returns -1 as expected but then calls to Serial.available() return non-zero.

This example:
Code:
void setup() {
  Serial.begin(9600);
  while(!Serial);
}
void loop() {
  Serial.println(Serial.available());
  Serial.read();  
  delay(1000);
}

Prints these results for Serial.avalable().
0
57344
49152
40960
32768
24576
16384
8192
0
57344
49152
40960
32768
24576
16384
8192
 
the list of numbers from Serial.available() are decreasing by 8192 per call. A clue?
I wouldn't think that the ISR/driver is able to buffer 57344 (0xE000) bytes. That's a multiple of 8192 (0x2000)
 
I'm experiencing some weird Serial problem too. Yesterday I simply cannot get any printout. Btw, I never get consistent printout from Setup on Teensy3, forced me to linkup an LCD from long time, but I almost get working inside the Loop. With this last version I got printouts only with very simple sketches but on several projects I cannot get any printout at all. Tomorrow I try to figure out what breaks out.
Win7/64, Teensy3,0. Ide 18/rc2
 
Last edited:
Do you wait for the port to open - like this:
Code:
  Serial.begin(9600);
  // wait for the port to open
  while(!Serial);
  // wait for 2 seconds just to make sure
  delay(2000);

Pete
 
Do you wait for the port to open - like this:
Code:
  Serial.begin(9600);
  // wait for the port to open
  while(!Serial);
  // wait for 2 seconds just to make sure
  delay(2000);

Pete

Hi Pete,
this never fully worked from the ancient time so I simply forget any printout in setup. Maybe it's something related to my 2xWin/64 computers but as I said now serial not always works even in Loop and any Wait,Delay solutions not helped. It's strange because the arduinos laying around my table all working (even in setup). Maybe driver get messed up during upgrade?
 
I find a solution apparently... I got another serial problem in an application I wrote in Java time ago and after some quick research I discovered that I'm actually run Java 32 bit on a 64 bit machine. I installed 64 bit version and magically I solved the serial problems.
On the other computer the same story but I still not deinstalled Java because I want to understand why it affects some serial communication and not all.

Edit: oops! Too early!

Adding while(!Serial); in setup worked a couple of times but now the While loop seems stucked in an infinite loop and sketch not start.
 
Last edited:
Deinstalled completely Java, cleaned all registers, cleaned folders with Java crap. Installed the correct 64 bit version... And finally now works as it should. Damn beans!
A question, Arduino IDE uses Java, it's possible to use an external java or the arduino one has something special?
 
Curious or bug:
Teensy 3.1

with
Code:
void setup() {
  delay(5000);
	Serial.begin(9600);
  Serial.print(Serial == 0);
}
and using the serial monitor in the Arduino IDE, the Serial == 0 print shows 0.
Same code, connect to COM16 via a dumb terminal emulator, not the IDE's serial monitor, the same Serial == 0 print shows 1.

In either case, the following loops forever, no matter the delay, no matter if it's in setup() or loop(), no matter which terminal display program is used.

Code:
while (!Serial)
   ;

I've just used a delay several seconds to give me time to open the desired terminal display (IDE or external).
Probably better to just loop and read one character from Serial before proceeding from startup. Do so in loop().
 
Last edited:
Hi!

I'm experiencing issues with uploading to the Teensy 3.0 and 3.1 boards with Teensyduino 1.18 RC2 on OS X 10.9 Mavericks.

I dug into the Java code and managed to assemble those two functions:

$ /Applications/Teensyduino.app/Contents/Resources/Java/hardware/tools/teensy_post_compile -file=sketch_jan30a.cpp -path=/var/folders/5d/dky9xc691m32kztqnhkn8bhw0000gn/T/build7991789148304455895.tmp/ -tools=/Applications/Teensyduino.app/Contents/Resources/Java/hardware/tools/

$ /Applications/Teensyduino.app/Contents/Resources/Java/hardware/tools/teensy_reboot -v -v -v -v -pmk20dx128 -chalfkay -P/dev/cu.usbmodem1411 -b12000000 -D -Uflash:w:/var/folders/5d/dky9xc691m32kztqnhkn8bhw0000gn/T/build7991789148304455895.tmp/sketch_jan30a.cpp.hex:i


Is there something missing?

Based on the blink example,
• When I connect the Teensy 3.0 or 3.1 board to the second USB port, port remains unchanged at /dev/cu.usbmodem1411 while it should be /dev/tty.usbmodem1421

• When I perform a ls /dev/tty.usb*, I obtain /dev/tty.usbmodem20561 not /dev/cu.usbmodem1411 or /dev/tty.usbmodem1421.

Thank you!
 
Last edited:
Known problems with Teensyduino 1.18-rc2 installer on WinXP? Attempted both before and after removal of previous version.

Installer does not allow continue after the Choose Location step.

Perhaps just have a corrupted download.

EDIT:
Never mind - more windoze weirdness fixed after a few reboots. Having to develop w/Win is getting tiresome - hopefully an errant Mac truck will flatten me long before the boss makes me go to .net.
 
Last edited:
Curious or bug:
Teensy 3.1

with
Code:
void setup() {
  delay(5000);
    Serial.begin(9600);
  Serial.print(Serial == 0);
}
and using the serial monitor in the Arduino IDE, the Serial == 0 print shows 0.
Same code, connect to COM16 via a dumb terminal emulator, not the IDE's serial monitor, the same Serial == 0 print shows 1.

In either case, the following loops forever, no matter the delay, no matter if it's in setup() or loop(), no matter which terminal display program is used.

Code:
while (!Serial)
   ;

I've just used a delay several seconds to give me time to open the desired terminal display (IDE or external).
Probably better to just loop and read one character from Serial before proceeding from startup. Do so in loop().

So I'm not the only one going mad with serial issues! I've experimented the same thing (with exact results) and was suprised that none has similar issues. It's frustrating since I use serial mostly for debugging and those long delays for startup Serial (that NOT always works) are boring since Teensy3 it's blazing fast during uploading and a snail during startup, thanks for those not wanted delay and while loops. I have also troubles when have to debug a library with serial, most of the time I can succesfully debug only the part of the code that runs in loop but never the initializations, etc. that happen in setup, even if I use those long delays and while stuff.
My only way to get a reliable serial connection:
Code:
while (!Serial)
   ;
but have to wait some seconds before open Terminal and I'm forced to open terminal aniway otherwise it just hang in while loop, all this with preview1 and all older ones, still not tried this one but I'm sure it will be the same.
Did you know if the other serial out has the same issues? I mean, working immediately without delays, while loop and whatever...
This is my only issue with Teensy3 and 3.1 so far, I love it, it's tiny, powerful, marvellous designed and first class supported but serial out it's a big no, no, no.
 
the hang in
while !Serial() ;

is intermittent, for me. Most often works properly.

It may be related to another discussion here where it is said that some host computer operating systems, some of the time, take too long to respond to the new connection establishment protocol exchanges.
 
I solved my Teensy 3.0 serial intermittent connection issues by not using the Arduino built-in serial monitor. Instead I use cu, screen, or Putty. The only minor annoyance is that I can't upload new code while a serial session is active, but it's quick enough to disconnect, upload, and reconnect. I work on OS X Mavericks, Linux, and Windows 7.
 
On windows, the terminal program called "Bray's terminal", has a user option to automatically close/reopen the serial port when the window focus comes/goes. So when you click away on some other window, it closes the port, and vice-versa.
 
  • Speed up SD library

Quick question - are those SD speed ups patched in to the standard SD library? I know it's a long shot, but do you have a general idea of how it compares to the 'stock' SD library and/or the SD fat library? Perhaps I'm missing a post somewhere, if so, I'd love a spin in the right direction.

Thanks!
 
Known problems with Teensyduino 1.18-rc2 installer on WinXP? Attempted both before and after removal of previous version.

Installer does not allow continue after the Choose Location step.
I had this problem too (Win7 64). Reinstalling the Arduino IDE fixed it.
 
Status
Not open for further replies.
Back
Top