Skip to content

Leonardo fails to send exactly 64 bytes. #3946

Closed
@embmicro

Description

@embmicro

When using the virtual serial port on the Leonardo I found that if I send exactly 64 bytes it doesn't send until another byte is sent. Below is a demo to show this problem.

void setup() {
  // put your setup code here, to run once:

}

void loop() {
  if (Serial) {
    if (Serial.available() > 0) {
      Serial.read();
      char buff[65] = "D_ENDPOINT(USB_ENDPOINT_IN (CDC_ENDPOINT_IN ),USB_ENDPOINT_TYPE";
      Serial.write(buff,64);
      Serial.flush();
    }
  }
}

After sending a character, nothing appears in the terminal. However, sending another then prints all 128 characters. This happens regardless of the serial port monitor I've tried. I've also tried on Linux and Windows 10 with slightly different, but similar results. This is with 1.6.5.

Metadata

Metadata

Assignees

Labels

Architecture: AVRApplies only to the AVR microcontrollers (Uno, etc.)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

Relationships

None yet

Development

No branches or pull requests

Issue actions