Skip to content

Serial Monitor with Teensy T4.x (probably others) does not receive input #810

Closed
@KurtE

Description

@KurtE

Describe the bug
I wrote a simple sketch to output so many lines to the terminal monitor as fast as possible. I am curious to see if the new monitor can keep up with a T4.x which runs at full speed USB...

The sketch is nothing special, but loops waiting for input data to allow me to type in how many lines to output.
I then start up the sketch and do what is necessary to get it back to comm port (more later), and then it shows up my first prompt, I type in lets say 100 in what I am pretty sure is the input window for it and hit enter and the sketch does not receive any data and as such does not run any farther.

@PaulStoffregen - not sure if any of this touches the Teensy integration code or not. It should be using the default Serial monitor?

Again secondary issue: I believe that with earlier versions of Arduino like 1.8.19, if you chose to use the default Arduino monitor code, versus the Teensy updated monitor code, that the user choice was preserved between builds.

To Reproduce
Steps to reproduce the behavior:

  1. Install the Teensy boards see https://forum.pjrc.com/threads/53548-Arduino-CLI-Alpha-Release-Teensy-Support?p=298914&viewfull=1#post298914 for board manager string
  2. start up the sketch... It is shown at the end
  3. Build and download it. Note: this one used the default USB type of Serial, default CPU speed...
  4. connect the Serial monitor and try to type in something.

Expected behavior
A clear and concise description of what you expected to happen.

I expected it in this case to output 100 lines plus summary to the serial monitor

Side note: At least on windows, when I now rebuild the sketch it switches the Serial port setting and terminal monitor will not work until I reset it.

That is I am trying the sketch: and the top shows I am on COM115
image

I then do a sketch upload and notice it changed what the active Serial is:
image

It then does not allow me to use Serial monitor:
image

so I go back to tools ports and switch back (Probably should have done screen shot after I selected the COM line.
image
And then we are back to:

image

Screenshots
If applicable, add screenshots to help explain your problem.
image

Desktop (please complete the following information):

  • OS: Windows 10
  • Nightly build 20210201

Additional context

void setup() {
  // put your setup code here, to run once:
  while (!Serial && millis() < 5000);
  Serial.begin(115200);

}

void loop() {
  while (Serial.read() != -1); // remove any thing still on queue
  Serial.println("\nEnter number of lines to output");
  uint32_t count_of_lines = 0;
  for(;;) {
    int ch;
    while ((ch = Serial.read()) == -1 ) ;
    Serial.write(ch);
    if ((ch >= '0') && (ch <= '9')) count_of_lines = count_of_lines * 10 + ch - '0';
    else break;
  }
  elapsedMillis em = 0;
  for (uint32_t line_num = 0; line_num < count_of_lines; line_num++) Serial.printf("Line %u\n", line_num);
  uint32_t delta_time = em;
  Serial.printf("*** Output %u lines in %u millis\n", count_of_lines, delta_time);
}

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions