Skip to content

USB (serial) logging freezes the device unless buffer is emptied. #5797

Closed
@AndKe

Description

@AndKe

Try this simple code:(on any leonardo)
I have found Leonardo to fail, and same microcontroller, on a pro micro to work:

 unsigned long last;

 void setup() {
   Serial.begin(115200);
   pinMode(13, OUTPUT);
 }

 void loop() {
   if (millis() - last > 999)  {
     last = millis();
     Serial.println("one second");
     digitalWrite(13, !digitalRead(13));
   }
 }

Observe how LED stops flashing whenever you open/close the terminal
(Ctrl-Shift-M)

To put it simply: if the log target is not ready, (DTR ?) - it all goes
to h*ll

Metadata

Metadata

Assignees

Labels

Type: BugUSB: CDC serialSerial interface used by MCUs with native USB (e.g. Leonardo) to communicate with the computer

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions