I have been using a Teensy 3.2 on Mac OSX El Capitan 10.11.3 and Arduino 1.6.7 with latest Teensyduino add on.
I've run into a bunch of problems with USB serial where I thought that there were serial buffer overruns, but now I am not so sure.
This simple sketch should be able to reproduce the problem:
If you then open the serial monitor and type a bunch of characters in, you will see the serial buffer fill up. I would expect that this will continue until the input buffer is full, but what happens (at around 200-300 bytes) is that the serial comms locks up. The LED continues to flash.
Any ideas?
edit: It isn't simply a problem with the serial monitor as it can be reproduced using "Serial Tools" and "Serial" applications as well with the Arduino IDE closed. It would appear that in certain conditions the LED stops flashing (when disconnecting the serial connection after lockup), so the Teensy 3.2 is clearly in a loop somewhere.
I've run into a bunch of problems with USB serial where I thought that there were serial buffer overruns, but now I am not so sure.
This simple sketch should be able to reproduce the problem:
Code:
void setup() {
Serial.begin(115200);
pinMode(13, OUTPUT);
}
void blinkLED() {
digitalWrite(13, HIGH);
delay(100);
digitalWrite(13, LOW);
delay(400);
}
void loop() {
static long last = 0;
int x;
long now;
now = millis();
if (now > last + 5000) {
x = Serial.available();
Serial.println(x);
Serial.send_now();
last = now;
}
blinkLED();
}
If you then open the serial monitor and type a bunch of characters in, you will see the serial buffer fill up. I would expect that this will continue until the input buffer is full, but what happens (at around 200-300 bytes) is that the serial comms locks up. The LED continues to flash.
Any ideas?
edit: It isn't simply a problem with the serial monitor as it can be reproduced using "Serial Tools" and "Serial" applications as well with the Arduino IDE closed. It would appear that in certain conditions the LED stops flashing (when disconnecting the serial connection after lockup), so the Teensy 3.2 is clearly in a loop somewhere.
Last edited: